The specified JRE installation does not exist - java

I was working on a piece of code in eclipse that was working fine when I stopped work about 8 months ago, when I tried running it today (with no changes made to the files/java installs as far as I know of) I got the above error from eclipse.
I have tried the solution from Eclipse: The specified JRE installation does not exist to no avail. I reinstalled JRE 8 and set jre1.8 as the default system library in the program but am still having the same issue. It persists whether I use jre1.8, jdk1.7, or an executable environment.
Any ideas would be appreciated. Thanks

First of all Eclipse requires JDK, JRE is not enough.
Go to Preferences > Add > Standard VM > Directory and add the path of the JDK Home you want to use.
Then add the JRE Library to your Project Build Path (select Java Build Path after right clicking your project)

Related

IntelliJ terminal jdk setting

I have a project in IntelliJ Idea that uses jdk 8. In my system I have many jdk installed for development. Every time I create a new terminal window inside IntelliJ, the latest system jdk (jdk 10) is used and not the project one (jdk 8 in this case) and I have to switch manually. Of course I realise the error only after some build which requires jdk 8 does not work properly.
Is there a possibility to set the jdk used in IntelliJ terminal?
Check Preferences->Tools->Terminal do determine the used shell implementation.
Change the shell path or change your environment settings with the used shell to take effect e.g. for setting JAVA_HOME and PATH.
You can even use the "shell integration" flag to load a custom rc config file. Please check the IntelliJ documentation for this.
You are not able to use the configured projects JDK in a dynamic way. If you need this, please file an enhancement request to Jetbrains.
You need to change the SDK version in project structure. You can change it through IntelliJ navigation top bar, by following this path:
File > Project Structure > Project tab > Project SDK
I repost the answer of #yole from the comments. It is not possible.
For anyone else who stumbles on this question, here is how I resolved a similar issue:
Maybe this is just my company's security*, but when a JDK is installed with an .exe, something like the following path is created and added to the root of the %path% variable:
C:\Program Files\Common Files\Oracle\Java\javapath
On that path you'll find a 'java' executable for the installed version of java.
The fix was to simply uninstall that version of java, via the system settings.
* I mean that I was unable to see the 'true' path variable, may have been my company's security.

Issue JDK creating a scala project in Intellij

I have installed the JDK jdk-8u144-windows-x64.exe in my computer in order to set up the tool IntelliJ to play with Scala, well before move forward to IntelliJ installation I ensured the JDK in my computer:
running path:
the running a java version:
Then, I installed the IntelliJ and the Scala plugins, so when finally I'M going to create my first project my laptop configuration is not mapping the JDK:
I tried to add the required environment just clicking on new and go thru the path where I installed the jdk but it doesn't go thru either.
Please, guys, I'm a bit nooby with Scala and IntelliJ, could you please guide me a bit. I tried to follow the instructions in this link but it is not going thru. https://www.scala-lang.org/documentation/getting-started-intellij-track/getting-started-with-scala-in-intellij.html
thanks
Make sure you have set environment variable JAVA_HOME to your java directory, IntelliJ detects JDK using that environment variable, or you can browse the path of java installation directory using "New" button beside jdk and select it.

After migrating Eclipse project from Windows to Ubuntu, Eclipse shows "cannot be resolved" compilation errors over all place

I had created a website in eclipse using tomcat as a server on windows 7 and it was working very fine. But now i have migrated from windows to ubuntu. I have installed java and it is working very well. But my eclipse is displaying error on each and every statement (this cannot be resolved). Please suggest how to solve this issue.
Most likely your eclipse is referring to JRE associated with windows path. Simply go to
Project Setting -> Java Build Path -> Edit/re-add JRE
wth correct path for your ubuntu system

Groovy and grails jdk issue

I wish I could give you guys more information on what's going on, but I really have no idea. I am trying to install groovy and grails tools suite from springsource and I am having trouble configuring it to work properly. I have the most up to date JDK, and the preferences show it, but I still get warnings and it does not build. I have posted some pictures below to show what is going on.
on your GGTS go to window
select java
select installed JREs
add-> Standard VM
jRE home select directory up to C:\Program Files\Java\jdk1.6.0_18
select jdk1.6.0_18 from installed JREs
I faced a similar issue (I am sure it is the exact issue) - Here are the steps to ensure it works correctly, I struggled with initially but this got it going.
Install JDK from http://www.java.com ,in a directory where there are NO SPACES in the path
Set JAVA_HOME to your JDK installation
Ensure %JAVA_HOME%\bin; is in your PATH variable.
On the command prompt run java -version, it should give you the path where JDK is installed
Install STS Springsource Tool suite.
Run your STS and create a new grails project and run it.
Let me know if that does not work.
It might be that you are launching Eclipse with a JRE even though you have a JDK installed as one of the compilers in your workspace. To find out if you are launching with a JRE or JDK, go to Help -> About GGTS -> Installation details -> Configuration
Look for the -vm option and make sure it is a JDK not a JRE.

Google App Engine JSP can't deploy: java.lang.RuntimeException: Cannot get the System Java Compiler. Please use a JDK, not a JRE

this is hopefully something simple but... Eclipse has been working relatively fine for everything except deploying to GAE.
I can run my GAE app locally, but when I try to deploy to google, I get this message:
java.lang.RuntimeException: Cannot get the System Java Compiler. Please use a JDK, not a JRE.
I have set the build path to JDK.
It also happens when trying to deploy the same project from more than one system (win7 and win8) so I suspect the problem is to do with the project itself. This particular project is existing and already running on google for years.
Interesting that this error only shows up when I have .jsp files in my app to deploy. If I remove the jsp files, it deploys without error. (kinda need the jsp files tho)
thanks
link to image of my build path
I had the same problem and was able to deploy successfully after forcing Eclipse to use
the JRE within my SDK directory (Win 7 64bit). To force Eclipse to use a particular JRE see this. It seems that the JVM that Eclipse uses, the JVM that app engine spawns, & the JVM that appconfig uses should all be the same. Hope this helps w/ your situation as well.
I tried setting my project jre to be the same as my eclipse jre according to AlohaCode's answer. This was insufficient for me. The answer was in my classpath, there is java.exe in C:\windows\system32 which was BEFORE my java home variable.
The solution is to put the java home path before the C:\windows\system32 entry.
I found the answer here: 2FL5sJ">https://groups.google.com/forum/?fromgroups=#!msg/google-appengine-java/RyFybJWUhU4/78UE_2FL5sJ
In Eclipse, go to: Window->Preferences->Java->Installed JREs , add->Standard VM TO JDK PATH\JRE. and If you had a JRE checked previously uncheck it and check this jre
The given advice solved my problem. The -vm argument cannot be the first line.
-vm
C:\Program Files (x86)\Java\jdk1.7.0_51\bin\javaw.exe
Setting -vm in eclipse.ini did not help. All other settings were seemingly pointing to the JDK. Out of desperation, I uninstalled all JREs from my system, leaving only the JDK. The consequence was that Eclipse would not start as the JDK bin directory was not on my PATH (Windows 8 here). Adding this in environment system variables got Eclipse to start. Thereafter I could deploy to app engine.
Removing the JRE file located in my C:/Program Files(*86)/Java folder , reopening the eclipse IDE resolved the issue.
I had Java JDK installed in my C:/Program Files/Java folder which was not detected earlier.

Categories