0

Well after getting all the help I could ever hope for, from you guys (thank y'all btw), I have come across a small issue. When trying to run my engine on another machine(runs flawlessly on MY computer), it gives me "java.lang.NoClassDefFoundError: org/python/util/PythonInterpreter". My engine uses jython for scripting, however nobody has jython installed, nor setup the classpath, so is there a way for me to distribute my Java/Jython powered engine on any machine without any hassle to the users?

I don't need my app to be ONE jar only when I distribute, but is this achievable?

Thanks for any reply :D


In the folder I wish to distribute, I have the jython jar, game engine class files, scripts, sounds, and whatever images I need. I even tried installing jython on the second computer, and after all this...It still didn't work :( is it this computer?

user000001
  • 32,226
  • 12
  • 81
  • 108
Luft
  • 185
  • 4
  • 17

2 Answers2

1

You need to include the relevant jars containing jython in your packaging of the game (for example - RPM, tar.gz, msi - depends on the OS you're using).
Then, you should have some script running your game (using java command line) and include the jython jars at the classpath.

Yair Zaslavsky
  • 4,091
  • 4
  • 20
  • 27
  • I have a class that creates the window and adds my game object My game object imports classes from org and core and runs scripts for game logic I'm only using scripts for instruction even with jython.jar in the same folder with all of my game's components, It fails to work :( – Luft Jul 14 '12 at 19:52
  • You have to specify the jython.jar to be in your class path. Please write a script that runs the java executable and adds the jython.jar to -cp. Placing it in same folder is not enough. I would also appreciate an upvote, for providing you the answer and helping you to solve your problem. – Yair Zaslavsky Jul 14 '12 at 21:00
  • thx, I think I'm much clearer on it now. :D oh and sorry about the vote..I don't have the required reputation <:L – Luft Jul 15 '12 at 03:53
  • Oh my gosh! Thank you SO MUCH for your help! It works now! All I can say is that you are awesome :D – Luft Jul 15 '12 at 05:01
0

See: Distributing my Python scripts as JAR files with Jython?

Though the question is about distributing Python scripts with Jython in a single jar, the same technique will work for distributing extra Java classes in one jar.

Community
  • 1
  • 1
Frank Wierzbicki
  • 1,566
  • 11
  • 10