2

I have been teaching myself Jython, and try as I might I cannot compile a script as a double-clickable .jar.

I have made a directory 'C:\Folder'. In it there is:

  • a copy of the standalone jython.jar,
  • a copy of the Lib folder from the Jython directory,
  • file.py, a Jython script that draws a Swing frame with a label, and
  • a copy of the 7-Zip command line tool (7za) for zipping.

I have looked here, here, here, and a few other places, and the furthest I've gotten is a .jar that runs with:

java -jar jython.jar -jar jython.jar arg1 arg2 

Which I get by renaming 'file.py' to '__run__.py' and zipping it and 'Lib' into 'jython.jar'.

I would, however, love to be able to skip the command line all together. So if anyone would walk me through the commands (I'm using Windows 7) to compile those into a double-clickable jar (let me know what else I may need, too) it would be greatly appreciated.

3
  • Do normal JARs open with Java? If not, you just need to add the file association (via the "Open With" dialog). Commented Feb 12, 2011 at 2:35
  • Oh geez, SO sorry. I'd been checking the post via the profile page so I wouldn't bump the views and didn't see the alert. I don't have any JARs on hand but the Open With window says 'Java Platform SE binary' for the ones I've made. Commented Mar 6, 2011 at 23:16
  • The second link you've got there, did you use the method in section 8 (i.e., 'What's a really easy way...')? That's the method I've used and I haven't had any problems. Commented Mar 10, 2012 at 12:42

1 Answer 1

0

If you have a folder with:

  • a copy of the standalone jython.jar,
  • a copy of the Lib folder from the Jython directory,
  • file.py, a Jython script ..

you can use launch4j to build an .exe on windows

have a look at the docs on launch4j

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.