Ollix

%s

This quick start guide will show you how to distribute your Jython scripts in a snap. By taking the power of Jython, you can of course integrate your Jython code with your Java code and even third-party Java libraries, Jump is smart enough to know how to pack all of them into a single, independent .jar file. Once you have the .jar file, you can simply send it to your friend and who won't have to leverage with Jython, the only thing he needs to know is how to execute a .jar file. You can also use Jump to make JAR library files, native Mac OS X application bundles, Windows .exe executables, and WAR files for Python WSGI applications. Supporting native Linux executables is the next. Jump makes things easier both for the developers and normal end users. By now, let's take a look at how Jump makes a single, independent .jar distribution.

The simplest "Hello World" example

As usual, you need to create a directory for your project. All the code for you specific project should be put in this directory. In Unix-like environments, you can do this by

mkdir helloworld

Then change into the created directory

cd helloworld

Now you can start writing you HelloWorld script with your favorite editor, I simply created a file called helloworld.py and the code looks like this:

def main():
    print "Hello World!"

Note that you must specify a main entry point to Jump so the final distribution knows where to start executing your program. Therefore, I use a function named main as our main entry point, and our final distribution will start from here. Now we can make our first distribution by executing

jump jar -m helloworld:main

The -m helloword:main indicates that our main entry point is the main function in the helloworld module. After Jump finishing its work, you should find a new dist directory located in your project directory, and the final distribution will be there. Now we can execute our first HelloWorld? program by running

java -jar dist/helloworld.jar

And you should see a Hello World! printed on your screen. It works!