1

i am using Eclipse and i have a QtJambi project which i would like to export in a .JAR file. I have tryed several times it never worked.

It worked for me on a Swing project, but with a QtJambi project, I dont know how to do it.

Here are the screenshots (maybe it can help you to understand my situation):

My QtJambi project (eclipse)

Error message when opening the .JAR file

Thanks for helping me.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Jonathan Rioux
  • 1,067
  • 2
  • 14
  • 30

1 Answers1

1

You didn't set a main class on the export (2nd page). So just running java -jar qt.jar isn't going to work since it has no clue what main(String[]) to invoke.

Nick Veys
  • 23,458
  • 4
  • 47
  • 64
  • I have tried it and it gives me this error message when i open the .jar file: http://img13.imageshack.us/img13/9083/error2rl.png – Jonathan Rioux Jan 08 '10 at 15:25
  • Run 'jar tf qt.jar' and see if the Main class is actually in there. You can also run 'jar xf qt.jar' to extract it and look at the MANIFEST.MF to see if it's correct. – Nick Veys Jan 08 '10 at 15:32
  • The 'jar tf qt.jar' command gives me that http://yfrog.com/2rcommandp and the Main class is correctly in the jar file. And in the MANIFEST.MF file, i get this: "Manifest-Version: 1.0 Main-Class: Main" What is the problem ? – Jonathan Rioux Jan 08 '10 at 15:41
  • Hmm, how you are running it? Double-clicking in Explorer? Having you tried 'java -jar qt.jar' from the command line? – Nick Veys Jan 08 '10 at 16:11
  • Ahhh, there we go. That should tell you something. You're missing the dependencies for Qt. Explained here: http://bit.ly/8ItGuM Is this your first venture into Java? You might want to read through some tutorials on Classpath management and JAR-based applications. Take a look here: http://bit.ly/4pfqh8 You could use either that section or the following Manifest-based method. – Nick Veys Jan 08 '10 at 17:18
  • I added "C:\qtjambi\bin" to the PATH variable environement and i still have the problem. Is there other things i have to set? – Jonathan Rioux Jan 08 '10 at 19:47
  • Yup, according to: http://bit.ly/8ItGuM under 'Configuring the system for Qt Jambi', you need to set the CLASSPATH as well. – Nick Veys Jan 08 '10 at 20:08
  • How do I set the classpath? I dont understand on wikipedia. – Jonathan Rioux Jan 08 '10 at 20:49