Archive: Java class not running after installation


Java class not running after installation
Hello everyone I am new to this forum and also using NSIS for 1st time.
I has one .nsi script for packing a .class file and some other files along with it.
The installer is working properly but the shortcut which is created is not working saying - "Could not find the main class. The program will exit".

The java program is working fine if I run it directly.

I am attaching the script and writing the the sample java file below.
Please help me with the issue or send me a script to make the java program installable.

/*SAMPLE JAVA PROGRAM*/
import java.awt.*;
public class NSISExampleApplication1 {
public static void main(String[] args)
{
Frame f = new Frame("test");
f.resize(600,400);
f.setVisible(true);
}
}


SetoutPath "$INSTDIR" also setting the shortcut parameter 'Start in' to $INSTDIR which is "$PROGRAMFILES\NSIS Example Application 1", however the shortcut is created in $SYSDIR.

You need to SetOutPath "$SYSDIR" just before create the shortcut for javaw.exe and add as parameter "$INSTDIR\NSISExampleApplication1", later, reset the SetOutPath "$INSTDIR" to continue do things into $INSTDIR or SetOutPath "$SYSDIR" and create the referred shortcut at the bottom of your install section.