Link to home
Start Free TrialLog in
Avatar of chalie001
chalie001

asked on

issue seting java home

hi am having issue checking java home in linux
 java --version
Unrecognized option: --version
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

i have this in my profile
export JAVA_HOME=/usr1/Oracle/jdk1.8.0_221
export PATH=$JAVA_HOME/bin:$PATH
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Not two hyphens in the command - just one
For example on Ubuntu...

# apt-get install -yqq openjdk-11-jre-headless

# which java
/usr/bin/java

# java --version
openjdk 11.0.4 2019-07-16
OpenJDK Runtime Environment (build 11.0.4+11-post-Ubuntu-1ubuntu218.04.3)
OpenJDK 64-Bit Server VM (build 11.0.4+11-post-Ubuntu-1ubuntu218.04.3, mixed mode, sharing)

Open in new window


The version of Java you're running seems very old with a potentially corrupt install.

Likely good to purge all of Java + reinstall, to ensure you have a working install.
ASKER CERTIFIED SOLUTION
Avatar of Duncan Roe
Duncan Roe
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Isn't that what i said above?