In Eclipse 2018-12, when the JDK 11 root directory is selected using the search button at Windows -->Preferences--Java--Installed JREs, Eclipse says "No JREs found". But JDK 11 can be added to the list of installed JREs by using the Add button. But when added what appears under the Name column of the Installed JREs box is JDK 11.0.2, not a JRE. When one goes through the search button and the root directory of JDK 8 is selected, the message that says no JREs is not displayed and its JRE is very smoothly added to the installed JREs list. For JDK 11, to be added to the list of installed JREs the Add button has to be used, not the search button. I would like to know what this means?
JDK 11 appears first in the Path variables of the user variables list. After JDK 11, appears JDK 8. Even if Java 11 is returned for the command java -version Eclipse still says no JREs found in JDK 11. In the JDK 11.0.2 root folder, no jre folder is found.
Even though this question is marked as a duplicate, it's not so. This question is about why Eclipse is behaving in a certain way regarding JDK 11 that's different from its behaviour regarding JDK 8.
I have never used the Search button (I always add JREs via the Add button) but I suspect that the button behavior was not updated for JDK 11. Since JDK 9, there is no more jre folder anymore. So, it continues seeking for jre folder and since there is no, it fails.
In any way, I don't see any big reason to use the Search button. Just use the Add button.
The answer to the above question may be found at On Windows, installing Java 11. Part of it is as follows. I now think that the page led to by the link above is not the right answer.
On Windows, installing Java 11 may not fix your problem. The Oracle
Java 11 installer does not appear to register itself as the default
JRE on the system path, or place its entries in the expected location
of the system registry.
As such, even if you plan to use Java 11 in your development
environment, you should consider also installing Java 8 so that your
system path has a JRE/JDK usable as the default for any current or
older Eclipse version.
But why wasn't JDK -11 added to the list of Installed JREs when Eclipse was restarted after Path variables were updated and the command java -version returned java version "11.0..-..."
My question is why didn't anybody knowledgable about this issue didn't reply. Some marked the question as duplicate even.
Go to to your Java folder and check if you've a jre folder inside, otherwise just download JDK again and reinstall.
Related
I am a regular IntelliJ user, but most of my co-workers use Eclipse. A lot of them say the latest version of Eclipse "2020-09", which requires a JRE "higher than Java 8" in order to run, cannot be used to develop projects requiring JRE8.
This is pretty surprising to me, since I know it is possible to install multiple JDKs and JREs on one machine, I've done it plenty of times.
What is the typical way a person would configure Eclipse 2020-09 (already installed) to work on a project that requires a Java 8 JRE?
JRE 8 apps in eclipse workspace is possible by having the jre 8 jdk. It is true that in order to use eclipse 2020-09 you need java 11+ jdk/jre, but making projects that support jre 8 is still possible.Even I still use 2020-06 and before. Here is a method you could use to get JRE 8 implemented back in your project. Although you can change the defaults, this one will help you change the environment back to java 8 for 1 project.
Right click the library named somthing like "JRE system library[JavaSE-11]". Press properties. This is what you will see JRE System Library chooser image
Choose "Alternate JRE" then click "Installed JREs"Step Image
Press "Add" then you will see 3 options. Choose standard VM. Find your java 8 jdk directory. Usually it is something like C:\Program Files\Java\jdk1.8.0_251.
You can configure the default arguments for your jvm runtime. Then simply hit ok,select the jdk-8 library and close it. Then choose alternate jre again and in the drop-down choose jdk-1.8.0 or some name like that. This will only work if you also have java 8 installed alongside java 11 that is configured properly JDK
You can use Java 11 to start the Eclipse 2020-09 and configure a project to compile with Java 8. The problem is if you want a Eclipse plugin that uses CORBA for example. This module was removed from Java 11 earlier. In this case, I recommend to use Eclipse 2020-06.
Earlier versions of 2020-09 was working with Java 8. I had it, too. Then I updated and I got the same error message like you.
I propose to use an older one or to install JRE 11 and set the JAVA_HOME env variable to it.
The inside the IDE you can set java 8 like an JDK and develope your project with Java 8 while eclipse is running with 11.
I'm doing a project in IntelliJ with GlassFish and it throws this error:
GlassFish requires Java SE version 6. Your JDK is version 0.
I ran the glassfish4/bin/asadmin start-domain command in a terminal but still get the same error.
I do have Java SE installed, SDK version 8u152 (I checked on Java Panel). Also, I don't know why it searches for jdk 9.
For me java home was good, the only issue was that the version was not matching up.
Open “glassfish -> config -> asenv.conf”.
Add the line AS_JAVA=PATH_TO_YOUR_JDK_DIRECTORY
The only stuff needs to be kept in mind is AS_JAVA=PATH_TO_YOUR_JDK_DIRECTORY should exactly match with the jdk version you mentioned in your intellij.
Now ->
C:\Program Files\Java\jdk1.8.0_40 is mentioned in intellij... file-> SDK's
set AS_JAVA=C:\Program Files\Java\jdk1.8.0_40 is mentioned in glassfish -> config -> asenv.conf
Which me, open asenv.conf in PATH_TO_YOUR_GLASSFISH/glassfish/config folder, go to end of lines and add set AS_JAVA=/PATH_TO_YOUR_JAVA/Java/JavaVirtualMachines/jdk-YOUR-VERSION.jdk
I tried all these approaches and none worked for me.
All answers talk about going to folder PATH_TO_YOUR_GLASSFISH/glassfish/config and then editing asenv.conf.
Editing that file didn't have have any effect.
I did go to that folder but ended up editing asenv.bat.
I literally added this to the end: set AS_JAVA=../../../../Program Files/Java/jdk1.8.0_261
The generic instruction would be: set AS_JAVA=PATH_TO_YOUR_JDK
Note: the asenv.conf file has quotes around values, asenv.bat does not.
I finally tracked the answer down from this question:
How do I specify the JDK for a GlassFish domain?
Go to folder '..\GlassFish-4.1.2\glassfish4\glassfish\config'.
Open in Notepad: asenv.bat
Add in end row:
set AS_JAVA=....\Java\jdk1.8.0_291
In my case, the issue was completely unrelated to IntelliJ setup and JAVA_HOME was pointing to correct path (version 1.8).
Despite that, runtime of java version 9 was actually used, so I uninstalled JRE 9.
Left JDK9, since removing the runtime was enough as a quick fix.
I've just installed Java EE Eclipse Mars, with a JDK 8u45 x64 and JDK 7u79 x64 JDKs. My eclipse.ini file is pointing the -vm option to my Java 8 JDK Home: C:\ambiente_mars\jdk8u45x64\bin\javaw.exe.
When I started Eclipse and was configuring my environment I started to set my Installed JREs like this (and like I've done since Indigo):
My Compiler Settings are configured this way:
After all this, I went to Execution Environments to choose the right VM for all the environments, but my configured JRE's are not there:
Actually, this JRE is not shown for any of the Execution Enviroments <= JSE 1.7. This very same screen, but now on Luna shows everything right, so I think I'm not doing anything wrong.
Maybe this is a bug? Can someone point another way to do it?
Thanks a lot in advance, lads!
Edit 1: Eclipse is x64 too. Thought it would be good to remember ;)
Try this: click "Search.." on item "Installed JREs". Choose your java folder.
Default is: c:\Program Files\Java\
I had this problem while looking into issues with an Eclipse (Neon .1) installation yesterday.
After trying plenty of different things, we spotted that the machine had both the environment variable "JRE_HOME" set to a JRE that wasn't the one running eclipse, and a _JAVA_OPTS (global java settings override) environment variable set. When we took both of these out, the execution environments finally started being found!
Unfortunately, we removed both at once, so I can't say which of the two it was, but it's another thing you could try changing.
First , you have correclty added the JDK(JRE) in your Eclipse , but the execusion environement changes from a project to an other and in the same workspace , that means , you have to right click on your project => Build Path => Configure Build Path => Libraries Tab you will find JRE System library [JDK...] => you click on and you click on Edit button then you can select the installed JDK in your machine.
Also in eclise.ini for eclipse or jbdevstudio.ini for Jboss developper Studio you set the full path of you installed JDK as a default vm
This is an example :
-vm
C:/Program Files (x86)/Java/jdk1.7.0_51/bin/javaw.exe
About the JAVA_HOME you can modify if by making you default JDK.
Hop that is useful for you.
Click on windows → preferences → java → Installed jres
Check jdk with version available or not
If available just tick the jdk checkbox and then goto execution environment and select javaSE version and then Compatible jre section add jdk
If not available click on add → select standard VM → in place of jre home add jdk bin folder path and click on apply → tick on jdk
then goto Execution environments and select javaSE version and then Compatible jre section add jdk
I have been having problems with appcompat_v7, someone told me to use Android-21 target. An error with that got me told to use JDK 1.8. I currently have JDK 1.6 installed. How do I switch Eclipse over to use JDK 1.8? I see no place to set the JDK path. The other time this question was asked, the questioner was referred to the JRE settings ... but the JDK is not the JRE, there are two separate paths. How do I get Eclipse to use the new JDK?
Project Menu > Properties menu item > Java Compiler > Compiler Compliance Level
Select your Java version from the pulldown menu. Obviously, you'll need to install Java 1.8 first to get it to show up as an installed version.
I've got an eclipse java project I need to open and run, it was built in Java 7, the default on my mac is appearing as java 6. When I right click the project > build path > try to change the java version .. it says Java 7 (unbound).
I've got java 7 update 51 installed on the mac.
I've tried installing java 7, but eclipse isn't recognising it.
Does anyone know of a solution?
Click that "Installed JREs" button and all will become clear.
Assuming that you have successfully installed an Oracle JDK 7 for Mac, you should be able to configure Eclipse to use that JRE. Here is my setup (using JDK 7u51):
Eclipse does not automatically find all Java instances, but has a list of known JREs.
To add your newly installed JRE, open Preferences, select the Java/Installed JREs page, and try search to find your new engine. If search does not yield results, select the Add... button, on the first page, select Standard VM, and then add '/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home' as the Java home (or something similar).