3

I am using WinRun4J utility to create a java desktop application(using JDK 1.6.0_45 64 bit on Windows 7 premium 64 bit) executable. I have created the EXE file by selecting "Export type" as 'Standard' and "Launcher Type" as '64-bit Windows'from the WinRun4J wizard after putting WinRun4J JAR(org.boris.winrun4j.eclipse_0.1.3) in the plugis folder of Eclipse.Below is .ihi file looks as of now.

working.directory=.
classpath.1=.\thirdpartyJAR\MQLink_Windows_Installer.jar
main.class=mqlink.Main
vmarg.1=-Dbase.dir=c:\mqlink
vm.version.min=1.6.0
vm.location=C:\Program Files\Java\jre1.6.0_43\bin\server\jvm.dll

Issue: I have to specify manually JRE location in the vm.location attribute to run my executable successfully. If I don't specify vm.location I get error "Failed to find Java VM". Not sure why this is happening I am doing all above stuffs with following configuration

  1. 64 bit Windows Premium OS.
  2. 64 bit JDK 1.6.0_45 to use with Eclipse.
  3. 64 bit JRE 1.6.0_43
  4. environment variable %path% is showing the path to JRE 1.6.0_43

As I have to deliver this executable to end users how to overcome this issue? so that JRE path should be taken automatically from the user system.

Rohit
  • 445
  • 2
  • 7
  • 17
  • I have this exact same problem, i.e. Java runtime path not being auto detected. Windows 8.1, JDK 1.8u31 – akauppi Feb 22 '15 at 13:55
  • akauppi, There could be couple of solutions of the issue I described above. 1. Bundle the JRE with the installer and specify the relative path in the vm.location atribute. 2. Run a batch file first which should find the JRE path on the system and write the JRE path into the .ihi file and populating the vm.location attribute with the required JRE value. – Rohit Feb 23 '15 at 02:30
  • Thanks. I was surprised that auto-detection of the JVM would not be part of WinRun4J's feature set. It looks like it was, from the options (why else would there be "min JVM version" etc. parameters). We're still undecided which bridge to use. WinRun4J looks very neat, but would do with more community involvement to iron things s.a. this out. imho – akauppi Feb 23 '15 at 09:19

1 Answers1

3

Too late for answer, but can help others who are still searching just putting

vm.location=%JAVA_HOME%

inside the configuration file should enable the application to detect the jvm from the system.

Ranjan
  • 475
  • 1
  • 5
  • 18