simple question. I got JDK 1.7 and 1.8 on my pc (Windows). I need both them. I got a "%JAVA_HOME%\bin;" entry in my PATH (JAVA_HOME=path_to_my_jdk_1_7). By command line I change the JAVA_HOME value like this:
set JAVA_HOME=path_to_my_jdk_1_8
Now if I type
C:\Users\Francesco>java -version
java version "1.8.0_20"
Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)
but when I type
C:\Users\Francesco>javac -version
javac 1.7.0_45
Why javac is still 1.7?
You need to run set PATH=%JAVA_HOME%\bin; again after setting the JAVA_HOME variable to 1.8 JAVA_HOME.
Related
Hello I installed java on my MacOS but its not working as expected.
When I do java -version below is the output I am getting instead of right version number:
abc#xxxxx ~ % java -version
openjdk version "15" 2020-09-15
OpenJDK Runtime Environment AdoptOpenJDK (build 15+36)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 15+36, mixed mode, sharing)
I see this is want installed under system and user:
Expected Output:
1234$ java -version
java version "1.8.0_261"
Java(TM) SE Runtime Environment (build 1.8.0_261-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.261-b12, mixed mode)
Perhaps you should fix your JAVA_HOME.
Here's the easiest way I know. Just add this to your ~/.bash_profile and ~/.zshenv:
export JAVA_HOME="$(/path/to/your/java)"
Then restart your terminals/IDEs.
When I run in my cmd :
java -version
java version "1.8.0_211"
Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
Java HotSpot(TM) Client VM (build 25.211-b12, mixed mode)
but I just edited my Java_HOME and my path to a new value :
echo %JAVA_HOME%
C:\Users\Me\Documents\JDK\jdk-11.0.6
Why my java version is still 1.8.0 ?
Why not specified correct version of java JRE in my vscode ?
Here is my java version.
$java -version
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
And env path here,
$env | grep JAVA
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home
And user setting in vscode,
"java.home": "/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home",
When open java project in vscode, next error occurred.
enter image description here
Hello.Thank you.
I just downloaded the linux 64 bit tar for eclipse mars. When I try and run the installer it gives me the following message
Version 1.6.0_31 of the JVM is not suitable for this product.
Version: 1.7 or greater is required.
I am on java version 1.8. See
$java -version
java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode)
Where does it get the 1.6 version of java?
.cshrc.mine
setenv $JAVA_HOME /path/to/Java8
setenv PATH /path/to/Java8/bin/:$PATH
Also
$ java -XshowSettings:properties -version
Property settings:
// Other props
java.runtime.name = Java(TM) SE Runtime Environment
java.runtime.version = 1.8.0_65-b17
java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode)
Try specify the JDK/JRE path by adding the following two lines into the beginning of your eclipse.ini file:
-vm
[your-path-to-java-executable]
In your eclipse.ini file you should point to java8
-vm
/opt/jdk18025/bin/javaw.exe
I hava install java8
but java -version output:
java -version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode)
How to use latest version?
Thanks.
Check out this how-to to change your java home path to the java 8 home
Use this command to update JAVA_HOME variable:
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`