I'd like to know how to setup IntelliJ to point to the JDK documentation so the documentation popups that display during code completion will show me what the function I'm looking at is going to do. For some reason IntelliJ isn't able to find the JavaDocs by default.
I'm also not 100% sure that the documentation is installed with the JDK that's installed with the OS. I don't see them in /System/Library/Frameworks/JavaVM.framework/ but I may be looking in the wrong place. If it's not included, I'd also like to know what needs to be downloaded and where it needs to be installed to get the JavaDocs for the JDK to show up in IntelliJ.
I had to combine the responses I got to this point and add a few extra details so I'm answering my own question.
Search for "Java developer" from Downloads for Apple Developers
Download and install "Java for Mac OS X 10.6 Update 9 Developer Package" (or later).
In IntelliJ, open File -> Project Structure.
Click on "SDKs" under "Platform Settings".
Add the following paths under the "Documentation Paths" tab (the paths may be different based on which JDK you're using):
/Library/Java/JavaVirtualMachines/1.6.0_29-b11-402.jdk/Contents/Home/docs.jar!/docs/api
/Library/Java/JavaVirtualMachines/1.6.0_29-b11-402.jdk/Contents/Home/appledocs.jar!/appledoc/api
Add the following path under the Sourcepath tab:
/Library/Java/JavaVirtualMachines/1.6.0_29-b11-402.jdk/Contents/Home/src.jar!/src
Thanks, #Yishai for the download location and #Gareth Davis for the location of the documentation after installing.
Update for 10.7/10.8 [Mountain] Lion:
Steps are the same except for these changes:
In step 2, download "Java for OS X 2012-005 Developer Package" (or later).
Use these paths instead in step 5.
/Library/Java/JavaVirtualMachines/1.6.0_35-b10-428.jdk/Contents/Home/docs.jar!/docs/api
/Library/Java/JavaVirtualMachines/1.6.0_35-b10-428.jdk/Contents/Home/appledocs.jar!/appledoc/api
Use these paths instead in step 7.
/Library/Java/JavaVirtualMachines/1.6.0_35-b10-428.jdk/Contents/Home/src.jar!/src
Quick (and dirty?) solution: Point IntelliJ to http://download.oracle.com/javase/6/docs/api/
have you installed the Apple Java Developer package?
It provides src.jar and docs.jar in /Library/Java/JavaVirtualMachines/1.6.0_22-b04-307.jdk/Contents/Home
Note this is since update 3. If these are present Intellij will just find them, or at least mine did.
details are in the Java update release notes
This should tell you what you need to know: Get local copies of Mac OS X Java source code and Javadoc – Concord Consortium wiki.
That page recommends going to https://connect.apple.com and downloading and installing “Java for Mac OS X 10.5 Update 2 Developer Documentation (Disk Image)” or the equivalent newer release. It describes a few ways to view the documentation, based on the Java jar file being located at a path like this:
/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/src.jar
Related
I installed the JDK8u40, but only find the javafx-src.zip.
Where can I find the source code for JDK? The src.zip?
Below is what I get after installation:
And btw, I didn't see the installation wizard! This is quite strange.
ADD 1
Today I tried several Java installation packages. All are downloaded from Oracle official site.
jdk-6u45-windows-i586.exe
jdk-7u75-windows-i586.exe
jdk-8u20-windows-i586.exe
jdk-8u25-windows-i586.exe
jdk-8u31-windows-i586.exe
jdk-8u40-windows-i586.exe
Both 6u45 and 7u75 installed well on my box. I can see the install wizard. And the src.zip is installed.
But 8u25 ~ 8u40 all installed silently. And no src.zip file is installed because I have no chance to select it in the wizard.
I am not sure if this is my fault or someone at Oracle made a mistake.
As #SubOptimal commented, the /s option indicates a silent install. I am wondering if there's an option to force the GUI install wizard to open.
I am using Windows 7 Enterprise x64 Build 7601 SP1
Make sure the Source code is not disabled when downloading.
Then as you can see on the picture, selecting "Source Code" will tell you exactly where it is located.
Notice that I've downloaded the 32 bits version to make sure to reproduce the same use case as you.
Edit
As per your new edits and comments, it seems what you want to know now is why you don't see the installation wizards. I'm pretty sure this is due to old-set registry key.
Run the following command
reg query hklm\software\microsoft\windows\currentversion\installer\UserData\S-1-5-18\Products /f "java" /s | find "HKEY_LOCAL_MACHINE"
Now, navigate to each of the returned path browsing with regedit and delete their entire parent (the big hexa number).
Re-try the installation and I'm pretty sure you will see the wizard.
As for the sources, Oracle documentation specify how to download them in silent mode.
jdk.exe /s ADDLOCAL="SourceFeature"
This is the way I got the src folder from jdk-8u172-windows-x64.exe file without installing.
Step1: Download jdk-8u172-windows-x64.exe file (Java SE Development Kit 8u172) from oracle site
Step2: Extract it and navigate to the path:
\jdk-8u172-windows-x64.rsrc\1033\JAVA_CAB9
Step3: Right click on file named "110" and extract it.
You will get the src.zip file.
It took me little while to figure this out. I hope it will help others.
Enjoy debugging Good Code!
I don't know why/where the src.zip is, but as an alternative, if all you want is the source and somehow the proposed method doesn't work for you, you could always pull directly from the JDK8u40 source tree.
You will need Mercurial instead of Git. This link talks about the hg clone command
Quoting from the OpenJDK Java.net site
The corresponding master forest jdk8u can be cloned using this command: hg clone http://hg.openjdk.java.net/jdk8u/jdk8u;cd jdk8u;sh get_source.sh .
In addition, the source code for the last release, 8u40, is available by cloning the 8u40 master forest : http://hg.openjdk.java.net/jdk8u/jdk8u40. The final build of that release was tagged as jdk8u40-b25.
There are differences between OpenJDK and Oracle's, though subtle
download JDK 8 from following link
http://www.oracle.com/technetwork/java/javase/jdk-8-readme-2095712.html
src.zip comes in-built with it
if you JDK installer silently skips installing the source. just open the control panel > programs an features and find Java. Right click on it and select change and then select the
source (option) ;)
Download the JDK
Run the Installer, but stop right away
Extract src.zip from C:\Users\<your_username>\AppData\LocalLow\Oracle\ss180121.cab
You can extract .zip from .cab with tool like 7Zip
Taken from
I recently started using Ubuntu and installed netbeans 6.9.1. I seem to be missing some javadocs tho that get installed with the windows version.
Basically the netbeans docs are there but when the code completion comes up it only tells me the function prototype. Where theres usually a description it says that the javadocs are not found and they should be added in the platform or library manager.
Basically I just want the docs explaining the methods for basic java, swing, and awt. Anyone know what files it is i want to be getting, and can I do it all with apt-get?
OS:
Ubuntu 10
Probably you have not installed java-doc package:
sudo apt-get install sun-java6-doc
or what ever is suitable for you.
I had the same problem. Solution is very simple:
You have to download "Java SE 6 Documentation" from this page (in Additional Resources list)
http://www.oracle.com/technetwork/java/javase/downloads/index.html
It is a zip file (~50 mb). Put this file to some place you like(I suggest you to put it to the JDK directory, but you can put it to your home directory) and then open NetBeans.
Select Tools -> Java Platforms. Then select JDK on the left window. In the Javadoc tab, click Add ZIP/Folder and choose file you recently download.
When you done this, your javadoc in code completition windows will work correctly.
I have my Windows work computer set up with JDE 5, but the plugin for the Mac OSX Eclipse on my home computer is JDE 6 and I can't seem to find a source to download it from.
I found a blog post about MacOS BlackBerry development, but it is from before the official MacOS plugin was released. Anything new on this front?
Just in case it saves anyone else wasting half a day, "FYI: Blackberry JDE 4.6 setup on Mac" on the BlackBerry support forums explains how to use the older Blackberry JREs with Eclipse on the Mac.
Were you still looking for an answer to this question? RIM has released the update for the Mac Eclipse v 1.1.2 Plugin. You have to go to "Help > Install New Software ..." and type the url: http://www.blackberry.com/go/eclipseUpdate/3.5/java . It should come up with options for the BlackBerry Java Plug-in Category. Clicking the arrow will reveal the other OS component packs (4.5 - 6.0). Install these (will take a while).
After this, go to the folder where your Eclipse plugins are located. You'll see the folders for the component packs (e.g. "net.rim.ejde.componentpack"). Copy the net.../components/bin folder from the 6.0 component pack to the other versions' components folder (backup the old one first).
In the components folder, there will be a BlackBerry.ee file. Copy the one from the 6.0 component pack into the other versions' components folder (again, backup the original). Open the new .ee file in a WYSIWYG text editor and change the version information to be accurate to the current component pack's version (e.g. 6.0.0.29 changes to 5.0.0.25).
In Eclipse, you need to add a system library. Open the Preferences and go to the Java > Installed JREs menu and click "Add...". When the window pops up, click "BlackBerry Execution Environment VM." For definition file, this is the BlackBerry.ee file for the version of the JRE you are adding. Name the JRE appropriately (e.g. BlackBerry 5.0). Next, click "Add External JARs..." and navigate to the net.../components/lib folder. Select the net_rim_api.jar file. Click finish and you should be good to go. (Repeat for other versions as necessary).
All that's left to do is to specify the correct JRE in your project properties (Java Compiler > {Click} Installed JREs link). Then, make sure the correct version is selected. Also, make sure there is only one JRE listed in the Project Explorer (newbie lesson learned).
Hope that helps if you still needed it to.
I should also add that I'm running my simulators on Windows via Parallels.
RIM has only released an Eclipse Plugin on OS X. The JDE is Windows-only and probably will always be Windows-only (RIM is trying to phase out the JDE and is encouraging all developers to move to the Eclipse platform).
Keep in mind that the Eclipse plugin for OS X is still VERY new and still has some rough edges - I tried it out and it crashed on more than one occasion! Also, there is no simulator available on OS X yet so you'll need a physical device to deploy and test on (I think it has to be a 9800 but I could be wrong). RIM has promised a simulator on OS X but probably not for another 6 months or so.
For Eclipse 3.6 you must use this url: http://www.blackberry.com/developers/jar/3.6/java/
If after downloading have error because too much authentication error, i'm suggesting you must re-create bb developer zone account & login using it (Kind of annoying, coz at my country bandwidth is limited & after waiting 3 hour, the installation is failed).
Also, in copying file don't forget copy fledge from net.rim.ejde.componentpack6.0.0_6.0.0.30/components/. If not when i try to add the definition file JRE i got this kind of error
"Execution Environment File Property-Dee.executable must point to a valid copy offledge.exe"
Hope this is can help.
Ahh. Seems like Apple removed java 5 and below from Snow Leopard (10.6). Leopard (10.5) still supports 1.4.2 and 5.0 and 6.0. You can find them in "/Applications/Utilities/Java Preferences.app".
I want to generate the javadocs for an open-source code-base I'm using. But I'm being asked for a "Javadoc Command" by the Eclipse Generate JavaDoc wizard and the help doesn't explain what this means. Is it wanting the path to the javadoc binary/jar or something else?
Yes, presumably it wants the path to the javadoc command line tool that comes with the JDK (in the bin directory, same as java and javac).
Eclipse should be able to find it automatically; are you perhaps running it on a JRE? That would explain the request.
Yes, it is asking for the application/executable that is capable of creating Javadoc. There is a javadoc executable inside the jdk's bin folder.
You may need to add a JDK (Java Development Kit) to the installed JRE's within Eclipse
Go to Window->Preferences->Java->Installed JRE's
In the Name column if you do not have a JDK as your default, then you will need to add it.
Click the "Add" Button and locate the JDK on your machine.
You may find it in this location: C:\Program Files\Java\jdk1.x.y
Where x and y are numbers.
If there are no JDK's installed on your machine then download and install the Java SE (Standard Edition) from the Oracle website.
Then do the steps above again. Be sure that it is set as the default JRE to use.
Then go back to the Projects->Generate Javadoc... dialog
Now it should work.
Good Luck.
Had this problem and solved typing this : C:\Program Files (x86)\Java\jdk1.7.0_51\bin\javadoc.exe
There are already useful answers to this question above, however there is one more possibility which I don't see being addressed here.
We should consider that the java is installed correctly (that's why eclipse could have been launched in the first place), and the JDK is also added correctly to the eclipse. So the issue might be for some reason (e.g. migration of eclipse to another OS) the path for javadoc is not right which you can easily check and modify in the javadoc wizard page. Here is detailed instructions:
Open the javadoc wizard by Project->Generate Javadoc...
In the javadoc wizard window make sure the javadoc command path is correct as illustrated in below screenshot:
I have installed Eclipse 3.3 on Mac OS X and it does not contain the src.zip file I am used to seeing with Windows and Linux installations. Where can I download the complete source code for the Java 1.5 JDK (must be specific versions).
I have been able to locate the full source code, however it contained the ungenerated Buffer implementations and so navigating NIO code was not possible.
Looking for the Java source typically found in the JDK src.zip, not the VM source.
You can get the Developer Documentation, which includes the source. The download requires you to have an ADC account.
Brian Clapper has already mentioned it in a comment, but the JDK downloads from Sun include src.zip. I don't know if there's any way to get it other than installing on a target platform, but you can install it on a Windows or Linux (virtual) machine and get src.zip from there.
Specifically for Java 1.5, the downloads are here
[Update]
Also, source distributions of the JDK are available from Sun from here. It seems that SCSL link is messed up and throws you for a loop, but JRL still works (if you don't mind going through it).
It is located in
/System/Library/Frameworks/JavaVM.framework/Versions.1.5.0/Home/src.jar
I do have the XCode stuff installed found on the installation disks that come with a Mac, so I don't know if the source code appears on a standard Mac installation of OSX.
/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/src.jar
More details on:
http://confluence.concord.org/display/CCTR/Get+local+copies+of+Mac+OS+X+Java+source+code+and+Javadoc
Unclear if that is even possible since the Mac JDK is not, to my knowledge, open source. It was created by Apple not Sun.