I have been trying java -d64
, but get Error: This Java instances does not support a 64-bit JVM. Please install the desired version.
I know I installed the 64-bit version, and when I go to Control Panel -> Programs and Features, I have "Java SE Development Kit 8 Update 212 (64-bit)". Any idea as to why this is?
1 Answer
First, you should run where java
or java -version
to make sure you are running what you think you are. If you aren't, get the path to the version folder of the java version you are trying to run and run this:
C:\Users\YourName>C:\Program Files (x86)\Java\<folder with version\bin\java.exe <args>
Or you could do this:
path = %path%;C:\Program Files (x86)\Java\<version>\bin
For example with a specific JDK version:
C:\Program Files (x86)\Java\jdk1.8.0_211\bin\java.exe -jar RunMe.jar
This will also maintain directory, so if you run either of these commands, this will act like the executable is copied to the folder you are running it from.
-
No Way. You are confused. Look at the error he gets it is nothing to do with a path. And there's also no reason for you to be giving an example with a jar file either.– barlopMay 20, 2020 at 16:32
-
No. IF he is getting a 64-bit instance error, that means that the instance he is running does not support 64-bit. My answer is a way to specifically run an instance that does support 64-bit. And the -jar was just an example to show that it still functions the same.– coresdevMay 20, 2020 at 16:35
-
If that's the case (and it may be), then his error is that he isn't running the one he installed. So what he should do is
where java
and verify that he is running the one he thinks he is running he isn't, then you should tell him that.– barlopMay 20, 2020 at 16:56 -
-
java -d64
is not a valid option. If you are executing an 64bit Java than it automatically runs as 64bit (there is no other possibility). If the standard Java version is not 64bit then you may have an old Java version lying around that has no (uni)installer. Executewhich java.exe
to see where it is installed and delete the whole installation directory.C:\Program Files (x86)\Common Files\Oracle\Java\javapath
listed on your environment path?