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/jdk 1.8.0_221
export PATH=$JAVA_HOME/bin:$PATH
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/jdk
export PATH=$JAVA_HOME/bin:$PATH
Not two hyphens in the command - just one
For example on Ubuntu...
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.
# 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)
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Isn't that what i said above?