Search code examples
javaubuntu-20.04path-variables

No Java virtual machine could be found from your PATH environment variable. You must install a VM prior to running this program


I know this has been asked several times but I can't seem to get rid of this error.
Setup:

  • I have installed java on ubuntu 20.04 with sudo apt install default-jre
  • echo $JAVA_HOME gives /usr/lib/jvm/java-11-openjdk-amd64/ which I see is correct.
  • PATH variable is also set correctly. When I type java in shell it shows me available options.
  • ls in the /usr/lib/jvm gives
    default-java java-1.11.0-openjdk-amd64 java-11-openjdk-amd64 openjdk-11

Error:
When I try to install lmadmin I get the following:
Preparing to install Extracting the installation resources from the installer archive... Configuring the installer for this system's environment... No Java virtual machine could be found from your PATH environment variable. You must install a VM prior to running this program.

Things I have tried so far:

  • add the export path lines to .bashrc , .bash_profile , /etc/environment
  • reinstalled the java package

Any help is appreciated.


Solution

  • Maybe it has been too late but i encounter the same problem when installing the CPLEX progrom. I had found the solution here at IBM support. Simply pass the java path using the LAX_VM flag.

    ./cplex_studio128.linux-x86-64.bin LAX_VM /opt/ibm-Java-whatever/java/bin/java