Eclipse launch error- error code 13 - java

Eclipse returns this error message when launching:
I am pretty sure that both the java installation and Eclipse are both for my 64-bit system.
Here is my .ini file:

Your version of Eclipse looks OK, based on the filename.
To check your version of Java, run java -version in a console. On Windows 7 with 64-bit Java 6 I get:
java version "1.6.0_27"
Java(TM) SE Runtime Environment (build 1.6.0_27-b07)
Java HotSpot(TM) 64-Bit Server VM (build 20.2-b06, mixed mode)
Check that this is the version being used by Eclipse, as shown in your error code. If not, call that version explicitly, e.g.
"C:\Program Files (x86)\Java\jre7\bin\java.exe" -version

I moved the
-vm
up below the first openfile, not the second.
PIC:

Related

JDK8 for NetBeans 12.2?

I'm trying to install JDK8 as a platform on NetBeans 12.2, but I keep getting this error message:
"Cannot detect and install the selected platform. The java or javac may not be executable."
Is there a way around this? Or is there a version of JDK8 that won't yield this error message?
Further: I should have mentioned that I'm on MACOS Big Sur.
Here's what I get with java -version in Terminal:
java version "15.0.2" 2021-01-19 Java(TM) SE Runtime Environment (build 15.0.2+7-27) Java HotSpot(TM) 64-Bit Server VM (build 15.0.2+7-27, mixed mode, sharing)
And here's what I get with javac -version:
javac 15.0.2
You are probably getting this message because the JDK executables haven't been added to your path as environment variables. Directly from the official java website, here's a guide on how to fix this problem.

Java appears to be outdated when using java -jar command

I have recently been writing some Java programs on my Windows computer. I have been trying to use java -jar to run compiled jars in order to see errors more clearly, but when I try to do this, I get the following error:
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/company/app/GUI has been compiled by a more recent version of the Java Runtime (class file version 57.0), this version of the Java Runtime only recognizes class file versions up to 52.0
This obviously means that my java version is outdated. However, when I took a look at the Java Updater, it shows that I am running the latest version.
Running java -version shows this:
java version "1.8.0_261"
Java(TM) SE Runtime Environment (build 1.8.0_261-b12)
Java HotSpot(TM) Client VM (build 25.261-b12, mixed mode)
So why is Command Prompt using an older version, and how do I change it?
Thank you for your help.
This error clearly indicates that you try to run a .jar file built with JDK 13 (major version 57) on a JRE/JDK 8 (major version 52) which is provided in PATH setting and thus invoked when running java -jar / java -version commands.
If you have JDK 13 installed on your machine, you need to check environment variable PATH and/or JAVA_HOME:
C:\Users\hp1>echo %JAVA_HOME%
C:\Java\jdk-13.0.2
C:\Users\hp1>echo %PATH%
C:\Windows\system32;C:\Java\jdk-13.0.2\bin
C:\Users\hp1>java -version
openjdk version "13.0.2" 2020-01-14
OpenJDK Runtime Environment (build 13.0.2+8)
OpenJDK 64-Bit Server VM (build 13.0.2+8, mixed mode, sharing)
If PATH refers JRE/JDK 8, you may create another variable and update PATH (copy non-java paths):
>set JAVA_13=**path_to_your_jdk_13**
>set PATH=C:\Windows\system32;%JAVA_13%\bin
If you do not have JDK 13 on your machine, to resolve this issue you should rebuild the .jar file to make it compatible with JDK 8 providing that the code is not using any features from the newer versions.

Problem with Dr. Java IDE

I have download Dr.Java ( the latest version) and tried to open it. But it shows an error, saying that I need a Java Runtime Environment 1.5.0.
So I go to my command prompt, and I put in : "java -version". Here is the result:java version "10" 2018-03-20
Java(TM) SE Runtime Environment 18.3 (build 10+46)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10+46, mixed mode)
So I clearly have Java downloaded. Is my version "too modern" for Dr.Java?
I had the similar issue as I was using jdk10. It seems like drJava is not compatible with new jdk10. I resolved my issue by installing jdk version 8. https://java.com/en/download/

No Java runtime present, requesting install

I have java JDK installed sucessfully in my mac os 10.9 ..
$ 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 try to run eclipse it asks me to jave SE 6 Runtime again !!!
It looks like eclipse is unable to locate the installed java. You can tell eclipse to point to this version of java by modifying eclipse.ini file
In eclipse.ini file, we need to add -vm option to point to the java8 location:
See: http://wiki.eclipse.org/Eclipse.ini#-vm_value:_Mac_OS_X_Example

R looking for the wrong java version

I installed/uninstalled java jre/jdk now many times and finally installed the older version 1.6.0_17 which is now located at "C:\Program Files\Java\jre6\bin". Now after all if I call 'java -version' within R i can see that R is looking for Java at the old path which is now wrong. The question is: Why is R looking for Java at the wrong path even so the windows path is set correctly? There are no double entrys within the windows path as far as I can see and I restarted R as well as Windows more then once since then. Any Ideas where R takes the wrong path from?
On windows shell:
> set
[..]
OS=Windows_NT
Path=C:\Program Files\Java\jre6\bin;
[..]
> java -version
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode)
within R:
> system("java -version")
Error: could not open `C:\Program Files (x86)\Java\jre6\lib\i386\jvm.cfg'
You problem depends on 64/32 bit versions.
You run 32-bit R, which use 32-bit command prompt and find 32-bit java. If you use 64-bit R then it runs 64-bit command promt and proper java.
You could check it by run 32-bit command promt (following this post):
Click Start.
Type %windir%\SysWoW64\cmd.exe in Start Search box.
Press Enter.
Type java -version
In my system it fails because I don't have 32-bit java. With standard cmd.exe I get proper path.
For possible solution there are two ways. Install 32-bit R and 32-bit Java or 64-bit R (which is officially supported from 2.11 version) and 64-bit Java. On my system (64-bit Windows 7) I've got both sets, so on 32-bit combination I get:
> system("java -version")
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing)
And on 64-bit:
> system("java -version")
java version "1.6.0_18"
Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
Java HotSpot(TM) 64-Bit Server VM (build 16.0-b13, mixed mode)
On 64-bit version you could call 32-bit Java using 32-bit cmd:
shell(
"java -version",
shell = file.path(Sys.getenv("windir"),"SysWoW64/cmd.exe")
)
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing)
About Shane's comment I think the question is how R get path to 32-bit cmd. Because I can't find a way to call 64-bit cmd on 32-bit R.
You're assuming that R is looking at the windows path, but the code is telling you that it's not. So check your assumption: R is getting the path somewhere else.
If I open up a command shell on my Windows machine and type "java -version" I get this:
C:\>java -version
java version "1.6.0_13"
Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
Java HotSpot(TM) Client VM (build 11.3-b02, mixed mode, sharing)
If I check the PATH on my machine, I get (edited for clarity):
C:\>set path
Path=;C:\JDKs\jdk1.6.0_13\bin;
If I open up R version 2.8.1 and run system("java -version") I get this:
> system("java -version")
java version "1.6.0_15"
Java(TM) SE Runtime Environment (build 1.6.0_15-b03)
Java HotSpot(TM) Client VM (build 14.1-b02, mixed mode, sharing)
>
So, like I said, R is not using my path to find java.exe. It's using something else.
I got to this page trying to work out why my JDK was reporting 64 bit despite the PATH and JAVA_HOME were pointing to 32 bit.
I dont even know what R is, but this article might help (it solved it for me)
http://www.tipandtrick.net/2008/how-to-open-and-run-32-bit-command-prompt-in-64-bit-x64-windows/
In a nutshell, dont run from 'cmd' use '%windir%\SysWoW64\cmd.exe' instead.
Or, put your JDK at the front of the path instead of the end (I dont think this is ideal).
You may also need to check the registry, R may have its own setting. You can also start regedit and do a search on the path to binary that it is starting.
There is a simple way to check which version of Java you have installed on your computer using the rJava package.
rJava::.jinit()
rJava::.jcall("java.lang.System", "S", "getProperty", "java.version")

Categories