简体   繁体   中英

Can java class run in nsis script?

I have installed NSIS plugin in My eclipse on windows platform. I have java class Calculator.java

public class sample {

public static Integer sum(int a, int b) {
int c = a+b;
return c;
}

}

while installing, from sample.java class using method sum(5,6) i want to get this result in nsis file.

I need help in communication with nsis file to java. Is it possiable in nsis?. If its possible please give me the steps.

can any one help this concept?

Thank you in advance.

You execute a Java JAR in NSIS with the ExecWait command.

ExecWait 'javaw.exe -jar \
            ${networkDir}\your.jar \
            parameters'

You can check the error flag if and only if your Java JAR returns a condition code:

System.exit(0);   // Good return
System.exit(8);   // Error return

As far as I know, you cannot reference Java methods in NSIS. Your Java JAR must have a main method.

Your Java JAR can write a file which can be read later by NSIS.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM