We help IT Professionals succeed at work.

Older Install "A suitable JVM could not be found. Please run the program......"

daskas27
daskas27 asked
on
Hello,
      I have a user who needs to install an older program that runs java. Whenever I attempt to install it I get an error stating “A suitable JVM could not be found. Please run the program again using the option –is:javahome <JAVA HOME DIR>. I uninstalled all instances of JAVA and reinstalled the latest version. The computer is running Windows 7 SP1. He has a laptop with basically the same configuration and it installs and runs fine. I am running the same configuration on my pc and it installs fine. Any help with this would be appreciated.

Thank you,
Dave
Comment
Watch Question

Radek BaranowskiFull-stack Java Developer

Commented:
what happens when you open command line and try to run

java -version

?
daskas27IT manager

Author

Commented:
Please see the uploaded jpg file
java-screen.jpg
Radek BaranowskiFull-stack Java Developer

Commented:
can you get JAVA_HOME variable ? is it set up ?

try in command line

set | findstr JAVA
daskas27IT manager

Author

Commented:
I am sorry. I don't understand.
Radek BaranowskiFull-stack Java Developer

Commented:
open command line like you did for trying out java -version, and run this command

"set | findstr JAVA"

and show me output please.
daskas27IT manager

Author

Commented:
I am not sure I used the correct character for the vertical line. Please see the uploaded file.
java-screen2.jpg
Radek BaranowskiFull-stack Java Developer

Commented:
yeah, you don't have JAVA_HOME variable set

so what you need to do is to press Windows+Pause/Break (to go into system info/settings),then Advanced system settings, Environment Variables and add JAVA_HOME variable to your system, like on the screenshot:

JAVA_HOME
then just just confirm with OK, in both dialogs.

now, when you open NEW command line (not the one you used previously), you should see JAVA_HOME set when you repeat the command "set | findstr JAVA". I would also expect your program to run too. can you please check ?
daskas27IT manager

Author

Commented:
First, I ran the command line from my pc which will run the program. I did check the variables on the users pc and there is not a variable for JAVA_HOME. How would I know the path?
Radek BaranowskiFull-stack Java Developer

Commented:
if you are able to run "java" in command line, then get java's path with

set | findstr PATH

there must be java directory on the path. strip it from /bin part and this is your JAVA_HOME directory
daskas27IT manager

Author

Commented:
I have copied and uploaded my path to notepad. I have actually copied my path to the users machine and though I can run the install he can't. I will upload a copy of his path in a minute.
path.txt
daskas27IT manager

Author

Commented:
Here is the path from the problem machine. Please see the uploaded file
path-2.txt
Top Expert 2016

Commented:
Uninstall all Java from your system then install the latest version. Reset JAVA_HOME to the directory into which it was installed. Then PREpend the following to PATH
%JAVA_HOME%\bin;

Open in new window


Then open a NEW cmd.exe and post output of

java -version

Open in new window

please
Radek BaranowskiFull-stack Java Developer

Commented:
I am not familiar with this Windows way of setting things up.
 anyway

in command line go to

c:\ProgramData\Oracle\Java\javapath       "cd c:\ProgramData\Oracle\Java\javapath"

and run

dir

it will list you actual files this directory contents link to. and willl reveal you the true java location which will probably be
c:\program files(x86)\Java\jre_xxx
Top Expert 2016

Commented:
it will list you actual files this directory contents link to
What makes you think that's a junction (link)?
Radek BaranowskiFull-stack Java Developer

Commented:
because I checked. that's the new scheme from our beloved oracle. I'm as surprised as you :) believe me. I gues it started from Java 8, before it was a standard convolution of Path/Java_home

http://nerdanswer.com/answer.php?q=689279

links
I'm still not sure how to navigate out of this, though.
Top Expert 2016

Commented:
Right! OK daskas27, so can you now please mimic the commands that Radek just ran?
daskas27IT manager

Author

Commented:
Done, same. Same on both machines. The one that is working and the one that is not.
Top Expert 2016

Commented:
You haven't posted the output that Radek posted. That's what we want
daskas27IT manager

Author

Commented:
Please see the uploaded filejava-screen3.jpg
Radek BaranowskiFull-stack Java Developer
Commented:
alright, then try to run your install program with -is:javahome option

<install program>  –is:javahome "C:\Program Files (x86)\Java\jre1.8.0_31"

it should run, I supposed, but it's hard to really cleanup java installation issues remotely. I would expect if you'd follow CEHJ's advice and wipe all existing Javas clear out of your machine, then install just a single one anew, it would work without all this stretching...but yeah, for now try the above please.
daskas27IT manager

Author

Commented:
I had to leave my desk for a while. I will attempt this as soon as I return.  Thank you
Top Expert 2016
Commented:
<install program>  –is:javahome "C:\Program Files (x86)\Java\jre1.8.0_31"

Open in new window


should really only be necessary if JAVA_HOME is either NOT set or you want to use something else

You DID make sure it's now set to c:\ProgramData\Oracle\Java\javapath didn't you? And you DID set PATH as i mentioned earlier?
daskas27IT manager

Author

Commented:
Thanks for your help
Top Expert 2016

Commented:
:)