Hey, I’m a programmer from team 4780 and I’m getting an error when I try to run a code I have in eclipse. I’m sorry if someone already posted this, but I couldn’t find anything. I’m not sure what exactly this error means and I need advice on how to fix it. Thanks in advance!
Are your environment variables setup correctly? It seems like you may have an incorrect/no JAVA_HOME specified.
It would appear that you are pointing your java home directory to a JRE (java runtime environment), not the JDK (java developer kit, I think). We had the same issue and once we downloaded and started using the JDK it was OK.
You’ll need to set your JAVA_HOME environment variable to point to a Java JDK instead of a JRE. If you don’t have a JAVE_HOME environment variable, create one and have it point to the JDK.
I had this problem and all I did was in Eclipse I went to Window->Preferences->Java->Installed JREs->Add->Standart VM
Then I found the newest jdk in JRE home, clicked next and select it.
This worked with out me even touching JAVA_HOME which I still do not even have in my system variables
While that does fix this problem, it ONLY fixes it for Eclipse and not for any other programs that may be expecting the JAVA_HOME variable to be pointing a JDK. Correcting the JAVA_HOME variable ensures this issue won’t arise on any other programs.
Thou due to Eclipse using JREs, it does not look at the system variable JAVA_HOME so you still need to set the location of the JDK in the preferences of Eclipse if you want to compile the code for the bot in Eclipse using Java
Eclipse DOES look at JAVA_HOME; we had this same issue in the past, fixed our home variable, and everything has worked fine since.
Then that is strange since for our team that did not work and as a reason I have been shown this site https://wiki.eclipse.org/FAQ_How_do_I_run_Eclipse%3F
which states “Eclipse DOES NOT consult the JAVA_HOME environment variable.”
The error message itself shows that the build failed and suggested the JAVA_HOME variable may need to be corrected. shrug
Yes since Eclipse has its own path for JAVA_HOME and that is located in the preferences
Not entirely correct, since we fixed our problem by correcting our actual JAVA_HOME variable. Anyways, I think we’ve debated this enough I’m outta here.
:yikes: Sorry I have just installed Eclipse on a new computer and found out that both methods work so go with with what ever you find the best
Thanks for the help. Problem solved, I had Jre 8 instead of jdk in JAVA_HOME.