views:

106

answers:

1

Hi,

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.

A: 

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
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
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
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.0Main-Class: Main" What is the problem ?
Jonathan Rioux
Hmm, how you are running it? Double-clicking in Explorer? Having you tried 'java -jar qt.jar' from the command line?
Nick Veys
Using the command line, it gives me this error: http://yfrog.com/j2command2p
Jonathan Rioux
Ahhh, there we go. That should tell you something. You're missing the dependencies for Qt. Explained here: http://bit.ly/8ItGuMIs 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/4pfqh8You could use either that section or the following Manifest-based method.
Nick Veys
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
Yup, according to: http://bit.ly/8ItGuM under 'Configuring the system for Qt Jambi', you need to set the CLASSPATH as well.
Nick Veys
How do I set the classpath? I dont understand on wikipedia.
Jonathan Rioux