PDA

View Full Version : Qt Jambi Manifest problem



stevey
14th December 2007, 07:33
I've installed the standard Java edition of Eclipse Europa and Jambi 4.3.3 as well as the Jambi integration for Eclipse.

I clearly have a "main" function defined and when I export to a .jar file I specify the class to be used as an entry point, yet when I try to execute the .jar file it claims that no entry point has been included.

Any faced this issue before?
I'm building against JRE 1.6.0_03.
I know it's probably more of a Java issue, but I wasn't sure if it's because of the Qt integration or what. I've never done Java with Eclipse so I thought I'd ask here.

Thanks.

marcel
14th December 2007, 09:59
Create a META-INF folder in your project and in it create a custom MANIFEST.MF.
You should add in it a main class entry, something like this:


Main-Class: your_main_class_name


Next, when you build the jar, when the wizard asks you for the manifest file, specify the one you just created, from the workspace.

stevey
14th December 2007, 11:35
In the .jar files I've been getting, if I open it with 7zip or whatever, there is a META-INF containing a MANIFEST.MF that has the correct <package.class name> path.

Is this different in some way to doing it explicitly the way you're suggesting?

marcel
14th December 2007, 11:39
Is this <package.class name> the "Class-Path" property or the "Main-Class" property?

stevey
15th December 2007, 04:48
The contents of the MANIFEST.MF file being generated is:

Manifest-Version: 1.0
Main-Class: FirstJambiTest.MainDialog


I've attached my test project.
TIA for any help you can give,

Steve

marcel
15th December 2007, 07:12
OK, the project looks good, both the source and the binaries. Also, the manifest seems to be correct so far.

The only thing that is missing is the "Class-Path" entry in MANIFEST.MF, which should contain the path to the Jambi jar, the complete path, such as: "Class-Path: c:\qtjambi_installdir\qtjambi.jar".

You should try editing the jar after it is created and add this entry.
Also, can you paste here the error you initially got? I don't have Jambi installed.

stevey
15th December 2007, 09:18
The error is "Could not find the main class. Program will exit."

I get the same error even with the Class-Path set as you suggested.

marcel
15th December 2007, 10:39
It doesn't make any sense... I've done this a lot of times(not with jambi, though) and never had any problems.

Can you attach the jar? I'll test it here.

stevey
16th December 2007, 00:02
Here tis.

I'm starting to wonder if it's a general Java thing.
I might try building my Java project against version 1.5 and see what happens.

stevey
16th December 2007, 22:25
Well, it's definitely a Jambi issue. I just created a vanilla Java project which displayed a dialog. After exporting it worked fine by double clicking hte .jar file. The was without including a specific MANIFEST.MF file.

There probably isn't anything WRONG with Jambi, just that I'm missing something.
I'll do a little more reading.

JuanC
2nd July 2008, 21:14
In Trolltech documents , there are this info :

http://doc.trolltech.com/qtjambi-4.4/html/com/trolltech/qt/qtjambi-deployment.html#creating-an-executable-java-archive

Anyone knows how to pack into a single .jar file , myapplication.jar , qtjambi-4.4.0_01.jar , qtjambi-win32-msvc2005-4.4.0_01.jar , qtjambi-linux32-gcc3.3-4.4.0_01.jar and this .jar file runs?

I tried it several times and no luck.