Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Windows error 2 occured while loading the Java VM " while installing  RSS feed

 
Smita Sant
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Flexera Install Anywhere to create an Exe .

Java is installed in my system and I am able to run other applications .
However with Java 1.8 60 version , it throws an error "Windows error 2 occured while loading the Java VM " while installing .
This works with earlier versions of java.

We are using the correct bit java .
I zeroed down on the problem, the way to resolve it is :

The System Environment Path now has : c:\programdata\oracle\java\javapath
This path has shortcuts to the JRE bins

However if I remove this path and add the actual JRE bin path to "PATH" in System Environment variable then it works.

I cannot figure out why it does not work for the shortcut. There is no issue if I uninstall and install an earlier version of Java.

Can you help me with the issue. Thanks.
 
Paul Clapham
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm pretty sure that "windows error 2" means "windows can't find the executable". Which probably means that your shortcuts to the JRE binaries were pointing to old versions which were removed when Java 8 was installed.
 
Rob Spoor
Sheriff
Posts: 20895
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:I'm pretty sure that "windows error 2" means "windows can't find the executable".

Confirmed. Error code 2 is ERROR_FILE_NOT_FOUND / "The system cannot find the file specified."
 
Smita Sant
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I checked the shortcut paths , here is what I found .

c:\ProgramData\Oracle\Java\javapath has :

10/15/2015 10:15 AM <SYMLINK> java.exe [C:\Program Files\Java\jre1.8.0_60\bin\java.exe]
10/15/2015 10:15 AM <SYMLINK> javaw.exe [C:\Program Files\Java\jre1.8.0_60\bin\javaw.exe]
10/15/2015 10:15 AM <SYMLINK> javaws.exe [C:\Program Files\Java\jre1.8.0_60\bin\javaws.exe]

This is the correct path of the JRE folder.
However the installer says it cannot find java if I give the c:\ProgramData\Oracle\Java\javapath path .

If I give "C:\Program files\Java\jre1.8.0_60\bin" in the path , it works fine.

The problem started with the latest release (1.8_60) version of java.

Can you help me resolve it. ?
 
Rob Spoor
Sheriff
Posts: 20895
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try uninstalling and reinstalling Java.
 
Smita Sant
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

No I have tried uninstalling java. And this same occurs for any of our clients who uses it and upgrades the java version.
 
Paul Clapham
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Presumably the installer doesn't follow symlinks? If you look at the Wikipedia article about NTFS symbolic link you'll notice that it says

Windows Installer does not fully support symbolic links.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!