micamoita
Posts: 11
Joined: Thu Jan 30, 2014 5:53 pm

Error embedding Jar and adding it to classpath

Fri Jan 31, 2014 9:35 am

Hello,

I have a question regarding an installer project designed to install a Java application.
I have a Jar with a main class that needs to be executed.
In the Java Products section I created a product, but trying to add my Jar to the classpath section ([JAR(s)...] button) or even trying to add it as embedded Jar results in an error which states "Invalid MSI Filename string [.].". A part from this error dialog, the Jar seems to be added anyway, and de project successfully builds.
The problem is that on the target machines the executable fails to invoke the main class, with the following error: "Could not find the main class <classname>". If I unzip the Jar contents in the same folder as the .exe, the class is found and the application works. It really seems the classpath hasn't been properly set.

Do you have any idea about what I may be doing wrong?

Thanks,
Michele

Dan
Posts: 4491
Joined: Wed Apr 24, 2013 3:51 pm

Re: Error embedding Jar and adding it to classpath

Fri Jan 31, 2014 1:50 pm

Hello Michele and welcome to Advanced Installer forums,

I'm not sure why this happens. Can you please send us the .AIP (project file) and the related .jar file (and its dependencies - if exist) to support at advancedinstaller dot com so we can investigate them?
Also, you can take a look on the can't find main class - JavaFX Application forum thread which debates a similar issue.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

micamoita
Posts: 11
Joined: Thu Jan 30, 2014 5:53 pm

Re: Error embedding Jar and adding it to classpath

Mon Feb 03, 2014 11:21 am

The error while setting the JAR is resolved as of AI 10.9. However, the "can't find main class" error remains.
I'm not allowed to send you the JAR, so as for now I fall back on a third party Jar-exe wrapper.
I'll let you know if I find a solution or if I need further assistance.

Return to “Common Problems”