I'm having issues seeing API documentation for Java 8 in Eclipse. Here's an example of the problem I'm having
Calendar myCalendar = Calendar.getInstance();
If I mouse over Calendar then I see all the correct documentation, however if I mouse over getInstance() I get a message saying
Note: This element has no attached source and the Javadoc could not be
found in the attached Javadoc.
I have the Javadoc location for rt.jar set to http://docs.oracle.com/javase/8/docs/api/, I've also tried downloading a local copy of the docs and had the same problem. Changing the link to the Java 7 docs fixes the problem I'm having.
Eclipse seems to be using the wrong anchor style (not sure how else to word it) when looking for methods. When it looks for the getInstance() method, it checks http://docs.oracle.com/javase/8/docs/api/java/util/Calendar.html#getInstance(), but it should be checking
Calendar.html#getInstance--
All brackets and commas seem to have been replaced by hyphens in the Java 8 doc links. I experienced this problem with Eclipse 4.3 (Kepler), 4.3 with the patches for Java 8, and now with 4.4 (Luna)
Is there a way to update Eclipse so that it properly displays the docs in the mouse over tooltips?
Setting the installed JRE to JDK 8 fixes your problem.
This can be done by going to
Window -> Preferences -> Java -> Installed JRE -> Edit -> Directory and selecting the JDK 8 installation folder
Step 1: Windows -> Preference -> Java -> Installed JRE -> Edit -> Directory (Specify the JDK directory (and not JRE))
Step 2: Click "Restore Defaults"
Step 3: Click OK
This worked for me in Ubuntu 14.10, Eclipse Kepler using openjdk-8
Window > Preferences > Java > Installed JREs > Click on your java-8-openjdk > Edit
For /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/rt.jar:
set Source attachment to:
/usr/lib/jvm/java-8-openjdk-amd64/src.zip
set Javadoc location to:
file:/usr/share/doc/openjdk-8-doc/api/
NOTE: If you don't already have the openjdk-8 java doc, install:
sudo apt-get install openjdk-8-doc
and for the source:
sudo apt-get install openjdk-8-source
I had the same problem. I did set the installed JRE to be JDK8. Still wasn't working until I clicked "edit" on the jre (under 'Installed JREs') then then clicked "Restore Defaults". Then it started working... Looking at each jar in that list I see it sets "Source attachement" and not "Javadoc location". Seems to work.
Related
I just installed Eclipse + Java and trying to make my first HelloWorld project.
But I have this error message after creating the project.
I have read the many posts but it does not help me, because I do not even have a JRE installed in my Eclipse,
See my screenshot.
What can I do?
Where to find the JRE?
I have already installed the JDK.
Thanks
I notice you haven't installed any JRE - which is probably your problem.
Download the version (example here 1.8) from Oracle.
Then on Eclipse, try:
Window -> Preferences -> Java -> Installed JREs -> Add
And follow the guide to your previously installed JRE.
Then go to:
Window -> Preferences -> Java -> Compiler -> Compiler compliance level
Ensure that matches the installed JDK.
In your screenshot click the Add... button
Select Standard VM and click Next >
Enter the installation directory of your Java 8 JRE (or better JDK) and click Finish
More issues with java. I just updated to the newest version of the java jdk and now none of my code is working. Eclipse is saying the type string does not exist, it is not finding the Scanner type in java.util, and I have no idea what happened. I don't know if java majorly changed or what. (Note the version I updated to was java 8 update 92)
In Eclipse, go to:
Window -> Preferences -> Java (open sub-menu) -> Installed JREs.
Then remove the old entries.
Press Add -> Standard VM, and specify the new jdk folder you've downloaded.
Its default location is in C:/Program Files/Java.
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'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).
The markers window shows this error -
Your project must be configured to use a JDK in order to use JSPs.
Eclipse by default uses it's own JDK. What could be the problem then ?
Along, I am using Google App Engine.
Marker Window -
Looks like eclipse is configured to use JRE not JDK
verify & change
windows > preference > java > installed JRE > choose JDK here
Eclipse when started using java from JRE it doesn't still respect this setting, specifying JDK;s java for eclipse fixed it
-vm
/home/non-admin/jdk1.7.0_02/bin/java
Go into your 'Project Properties', then go to 'Java Build Path', then to 'Libraries' tab, there you will see 'JRE System Library'. If that doesn't points to the JDK you are using, then 'Edit' it to the correct one.