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.

Community
  • 1
  • 1
Frazer
  • 21
  • 4
  • Do normal JARs open with Java? If not, you just need to add the file association (via the "Open With" dialog). – Hut8 Feb 12 '11 at 02: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. – Frazer Mar 06 '11 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. – Cam Jackson Mar 10 '12 at 12:42

1 Answers1

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

Blauohr
  • 5,985
  • 2
  • 25
  • 31