Error while checking the java version in command prompt [duplicate] - java

This question already has answers here:
How to set the environment variables for Java in Windows
(17 answers)
Closed 5 years ago.
On my windows 7, 64 bit pc, I have installed java but while typing java -version in command prompt it shows java' is not recognized as an internal or external command, operable program or batch file.".and there is no java folder in program files even.The java version which i have installed is 8 and it is 64bits.

Try setting the environment variables.
The answer can be found on this SO page.

You must install the latest version of JDK from here:
Download JDK From Here
After Installing the latest version follow these steps :
Setting Path in Java
Hope this will help you out.

Related

Java Version check in Command Prompt [duplicate]

This question already has answers here:
java --version doesn't work in the command line
(2 answers)
Closed 10 months ago.
I am using a 32 bit windows 7 OS and I have installed JDK 8 as it was the only available JDK version for a 32 bit system. I have also given the path in the environment variables. But, when I am trying to check the java version in the command prompt typing java --version, I am getting a fatal error.
You should double check if your path variable is set correctly. It should point to the ...\bin\ directory where the 'java.exe' is located. Because thats whats called with 'java --version'.

Updating java JRE to match what is compiled with JDK [duplicate]

This question already has answers here:
How can I get Java 11 run-time environment working since there is no more JRE 11 for download?
(4 answers)
Closed 3 years ago.
I'm trying to run a java application that I have compiled using the IntelliJ IDEA, by the commandline running the following command:
java myApp.Main
This gives me the following error:
"Exception in thread "main" java.lang.UnsupportedClassVersionError: FlightConverter/Main has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0"
In IntelliJ the JRE set to run in the run configuration is: /Java/jdk-11.0.3, but I get the error above when I try to run it. When i type java -version in cmd I get "1.8.0_211"
I cant really seem to find out how to update my current JRE to match what is used by the compiler either? It seems I'm only able to find JRE 8.xx online
I'm sure you can get location of java 8 from local system and set that as a compiler in IntellIJ IDE.. This way both your system and IDE works only on Java 8 and everything will work fine...
Hope this helps...

Setting PATH env on Linux [duplicate]

This question already has answers here:
JAVA_HOME and PATH are set but java -version still shows the old one
(10 answers)
Closed 4 years ago.
I tried installing java on Amazon linux.
I installed jdk 1.8.0 and I changed PATH to .bash_profile
export JAVA_HOME=/home/.../jdk1.8.0_192
export PATH=$JAVA_HOME/bin:$PATH
but java -version still returns old java version (1.7.0)
I checked the result was JAVA_HOME = /usr/lib/jvm/jre
if I check which java then the result is /usr/bin/java
how to change the java version to the new one?
you need to type below command on shell
sudo update-alternatives --config java
It will display all available JRE and you need to type the number which java you want to select(You can perform this for javac also).

how to change java -version on windows to show Java 1.9 [duplicate]

This question already has answers here:
How to set java_home on Windows 7?
(18 answers)
Closed 4 years ago.
I have java 1.9 installed on my machine. I can see it in installed programs. But when i type java -version on command prompt it still shows 1.8. How can i change it ?
I assume you meant 1.8
Windows and Linux allow multiple JRE to be installed. They have different mechanisms for determining which JRE is used by default. Basically, it comes down to your system path.

Eclipse can't start anymore [duplicate]

This question already has answers here:
Eclipse - no Java (JRE) / (JDK) ... no virtual machine
(35 answers)
Closed 7 years ago.
when I click on eclipse it says a jre or jdk must be available in order to run eclipse. etc
how do I fix this?
thanks you
David,
After installed JDK in your machine then configure the PATH, CLASS_PATH and JAVA_HOME variables in the Environment variable then Eclipse will open without any issues.

Categories