Question

I have the JSmooth software in my local system. I am trying to generate my jar file as exe but I am getting error when I click on run the exe it is showing.

java virtual machine launcher --->
    Could not find main class: MainClass .Program will exit.

How to use JSmooth software to create a working executable?

No correct solution

OTHER TIPS

Can you execute your jar file by double clicking on it ? Any jar package for executing will need a file named MANIFEST.MF which located in META-INF directory in that package. In that file you can tell VM where to find main method of your program to start execution. Many IDE's like netbeans by default will generate an executable jar file (I mean JVM executable package and not binary exe file!) when you build your project.
I don't know about JSmooth, but for running a jar file, you must say jvm where to find main method. So you may want to check your jar file & your MANIFEST.MF should contain something like this:

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.x.x
Created-By: 1.x.x (Sun Microsystems Inc.)
Class-Path: 
X-COMMENT: Main-Class will be added automatically by build
Main-Class: path.to.main.class

JSmooth has issue for import files. Better you can go with Launch4j tool. Its working perfectly.

just download it from http://sourceforge.net/projects/launch4j

Steps to be followed 1. give any name as output file with .exe extension and select yr jar file under basic tab 2. mention Min JRE version as 1.4.0 under JRE tab 3. Save it and execute. It creates exe file.

I found that the MANIFEST.MF had listed my main class as "Main", and not "Main.class". Adding the class extension fixed it for me.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top