Netbeans v11.2 and Oracle JDK13 javadocs issues - java

I'm running NB 11.2 with Oracle JDK 13.0.1+9
NB's Java Platform ->> Javadocs (tab) is empty (no entries).
When I type (NB editor) java.math. -or- java.nio. (examples), pop-open menus shows methods AND the full javadoc info for each method as expected.
But when I type java.sql. -or- java.rmi. (examples), I get the methods listed, BUT Javadoc shows just the package and class definition and a message ((THE MESSAGE)) that reads:
Javadoc not found. Either Javadoc documentation for this item does not exist or you have not added specified Javadoc in the Java Platform Manager or the Library Manager.
Here's a screenshot:
So I added this URL to the Java Platforms ->> Javadocs tab:
https://docs.oracle.com/en/java/javase/13/docs/api/
No help...same problem.
So I added this URL Java Platforms ->> Javadocs tab:
https://docs.oracle.com/en/java/javase/13/docs/api/java.sql/
Now, the results changed, but still wrong. I've lost THE MESSAGE, but the package and class def shows with all blank text afterwards.
If this isn't a bug in NB/Oracle URL, then it seems very poorly documented which is evidenced by the sheer number of questions asked on SO.
Also, I'd like to download the whole javadoc .zip file and use a file ref instead of a URL. Is this still possible?

I'm running NB 11.1 with Oracle JDK 13.0.1+9...
That's a problem in itself. While it may appear to work, NetBeans 11.1 does not support the use of JDK 13. From the Product Manager for NetBeans: "Apache NetBeans 11.1 supports JDK 8 to JDK 12". Unfortunately I can't see this being explicitly stated anywhere on the Apache NetBeans web site.
So to successfully access Javadocs for JDK 13 in your applications:
Download and install Apache NetBeans 11.2.
In NetBeans 11.2, use Tools > Java Platforms to add JDK 13.
Follow the instructions below to install a local copy of the Javadoc for JDK 13.
Also, I'd like to download the whole javadoc .zip file and use a file
ref instead of a URL. Is this still possible?
Yes:
You can download the JDK 13 API Javadoc file jdk-13.0.1_doc-all.zip from here.
There no need to unzip the downloaded file.
In NetBeans 11.2 open Tools > Java Platforms > select your JDK 13 platform entry.
Click the Javadoc tab then click Add Zip/Folder...
Navigate to the downloaded file jdk-13.0.1_doc-all.zip, select it, then click Add Zip/Folder...
An entry for it will be added in the Platfrom Javadoc list. Remove any https URLs you had added previously, so that it is the only Javadoc entry for JDK 13:
Once you have done all that, Javadoc should work fine for your JDK 13 applications. Here's an example using java.rmi package which was not working for you:

Related

JAVA SE 8, JDK-8u151.exe installation doesn't include src.zip file [duplicate]

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

Javadoc not Found [duplicate]

Right now when I use a built in method, it shows me the returns types and nothing else that's useful.
Is there something I can download to make the info from the intellisense more robust?
Javadoc not found. Either Javadoc
documentation for this item does not
exist or you have not added specified
Javadoc in the Java Platform Manager
or the Library Manager.
You need to download the JDK API docs, which you can get from this page.
Then in NetBeans, go to Tools -> Java Platforms -> Javadoc to specify the directory where you downloaded them.
The javadocs come in the jdk package or at least in JDK 1.8. You can add the zip files named src.zip and javafx-src.zip to the tools>java platform>Javadoc.

Where can I find the JDK documentation, and how can I read it offline? [duplicate]

When writing Java code, I refer extensively to the Javadoc—that is, the Java® Platform, Standard Edition & Java Development Kit Version x API Specification. I know how to read it online from the website, but I would like to download a copy to my computer so that I can read it offline when no Internet connection is available.
How can I download the documentation? Is there a way to "download" the Javadoc (JDK documentation) from an online site to a local file?
The online docs I am using tend to reject clients such as Eclipse, making work difficult, so I need to pull them onto my machine and attach them to my library JAR.
Links to JDK documentation
Java SE
Download
Web
Other
21 (Early-Access)
Not yet available
Javadoc
Project page
20 (Early-Access)
Not yet available
Javadoc
Project page
19 (current) 🟢
Downloads page
Javadoc
Doc home
18
Downloads page
Javadoc
Doc home
17 (LTS)
Downloads page
Javadoc
Doc home
16
no longer available
Javadoc
Doc home
15
no longer available
Javadoc
Doc home
14
no longer available
Javadoc
Doc home
13
no longer available
Javadoc
Doc home
12
no longer available
Javadoc
Doc home
11 (LTS)
Downloads page
Javadoc
Doc home
10
no longer available
Javadoc
Doc home
9
no longer available
Javadoc
Doc home
8 (LTS)
Downloads page
Javadoc
Platform homeDoc home
7
no longer available
Javadoc
Doc home
6
no longer available
Javadoc
Doc home
Also of interest:
Release Notes
History of Java SE versions
First, make sure they don't already offer an download in zip form or similar.
Then, make sure you are actually allowed to do this (this may depend on where you live, and on any conditions mentioned on the web site from where you want to pull this).
Then, have a look at the Wget tool. It is part of the GNU system, thus included in many Linux distributions, but also available for Windows and Mac, I suppose.
Something like this works for me:
wget --no-parent --recursive --level inf --page-requisites --wait=1 \
https://epaul.github.io/jsch-documentation/simple.javadoc/
(without the line break; it should be escaped by the \ backslash here).
Look up what each option does in the manual before trying this.
If you want to do this repeatedly, look into the --mirror option.
For downloading other websites, --convert-links might also be useful, but I found that is not needed for Javadocs, which usually have the correct absolute and relative links.
This downloads lots of the same copy of the index.html file with appended ?... names (for the FRAMES links on each page). You can remove these files after downloading by adding the --reject 'index.html\?*' option, but they still will be downloaded first (and checked for recursive links). I did not yet find out how to avoid downloading them at all. (See this related question on Server Fault.)
Maybe adding the right recursion level would help here (I didn't try).
After downloading, you might want to zip the resulting directory to take less disk space. Use the zip tool of your choice for this.
For any Javadoc (not just the ones available for download) you can use the DownThemAll addon for Firefox with a suitable renaming mask, for example:
*subdirs*/*name*.*ext*
https://www.downthemall.org/main/install-it/downthemall-3-0-7/
It's possible to use some older versions of the DownThemAll add-on with Pale Moon browser.
You can use something called Dash: Offline API Documentation for Mac. For Windows and Linux you have an alternative called Zeal.
Both of them are very similar. And you can get offline documentation for most of the APIs out there like Java, Android, Angular, HTML5, etc. ... almost everything.
I have also written a post on How to install Zeal on Ubuntu 14.04
update 2019-09-29: Java version 11
The technique below does not now work with Java 11, and probably higher versions: there is no way of ignoring multiple "broken links" (i.e. to other classes, other APIs). Solution: keep your javadoc executable file (or javadoc.exe) from Java version 8
There are good reasons for making your own local javadocs, and it's not particularly difficult!
First you need the source. At the time of writing the Java 8 JDK comes with a zip file called src.zip. Sometimes, for unexplained reasons, Oracle don't always include the source. So for some older versions (and who knows about the future) you have to get hold of the Java source in another way. It's worth also being aware that, in the past, Oracle have sometimes included the source with the Linux version of the JDK, but not with the Windows one.
I just unzipped this file... the top directories are "com", "java", "javax", "launcher" and "org". Directory launcher contains no files to document.
You can generate the javadocs very very simply from any or all of these by CD'ing at the command prompt/terminal to the directory ...\src. Then go
javadoc -d docs -Xmaxwarns 10 -Xmaxerrs 10 -Xdoclint:none -sourcepath . -subpackages java:javax:org:com
NB note that there is a "." after -sourcepath
Simple as that. Generating your own javadocs also has 2 huge advantages
you know they are precisely the right javadocs for the JDK (or any exernal jar file) you are using on your system
once you get into the habit, reconstituting
your Javadocs is not a tiresome challenge (i.e. where to go looking for them). For example I just unzipped a couple of source jars whose packages are closely coupled, so their sources were in effect "merged" & then made a single Javadoc from them...
NB Swing is semi-officially DEAD. We should all be switching to JavaFX, which is helpfully bundled with Java 8 JDK, but in its own source file, javafx-src.zip.
Unzipped, this reveals 3 "root" packages: com, javafx and netscape (wha'?). These should be manually moved over the to appropriate places under the unzipped src directory (including the JavaFX com.sun packages under the Java com.sun strcture). Compiling all these Javadoc files took my machine a non-negligible time. I'd expect to see all the JavaFX source classes in with all the other source classes some time soon.
BTW, the same thinking applies to documenting any and all Java jars (with source) which you use. However, all versions of most jars will be found with their documentation available for download at Maven Central http://search.maven.org...
PS afterthought: using Eclipse and the "Gradle STS" plugin: the "New Gradle STS Project" wizard will create a gradle.build file containing the line
include plugin: 'eclipse'
This magically downloads the source jar with the executable jar (under GRADLE_HOME) when you go
./gradlew build
[addendum 2020-01-13: if you have chosen not to include the Eclipse plugin in your build.gradle, it would appear that you can go (with the selection on your project in the Project Explorer) Right-click Gradle --> Refresh Gradle Project to get Eclipse to download the source files.]
... giving you an extra degree of certainty that you have got the right src and therefore the right javadoc for the dependency in question.
I have used Javadoc packaged by Allimant since I was in college.
The Javadoc is in the CHM format (standard Windows help format), so it's the best viewed when you're using Windows.
For the download of latest Java documentation (JDK 8u77) API
Navigate to http://www.oracle.com/technetwork/java/javase/downloads/index.html
Under Addition Resources and Under Java SE 8 Documentation,
click the Download button.
Under Java SE Development Kit 8 Documentation → Java SE Development Kit 8u77 Documentation.
Accept the License Agreement and click on the download ZIP file.
Unzip the downloaded file
Start the API documentation from jdk-8u77-docs-all\docs\api\index.html
For the other Java versions API download, follow the following steps.
Navigate to http://docs.oracle.com/javase/
From Release dropdown, select either of Java SE 7/6/5.
In corresponding Java SE page and under Downloads left side menu,
click JDK 7/6/5 Documentation or Java SE Documentation.
Now on the next page, select the appropriate Java SE Development Kit 7uXX Documentation.
Accept License Agreement and click on Download ZIP file.
Unzip the file and start the API documentation from
jdk-7uXX-docs-all\docs\api\index.html.
In this case ... make your own javadocs!
First you need the source. At the time of writing the Java 8 JDK comes with a zip file called src.zip. Sometimes, for unexplained reasons, Oracle don't always include the source. So for some older versions (and who knows about the future) you have to get hold of the Java source in another way. It's worth also being aware that, in the past, Oracle have sometimes included the source with the Linux version of the JDK, but not with the Windows one.
I just unzipped this file... the top directories are "com", "java", "javax", "launcher" and "org". Directory launcher contains no files to document.
You can generate the javadocs very very simply from any or all of these by CD'ing at the command prompt/terminal to the directory ...\src. Then go
javadoc -d docs -Xmaxwarns 10 -Xmaxerrs 10 -Xdoclint:none -sourcepath
. -subpackages java:javax:org:com
NB note that there is a "." after -sourcepath
Simple as that. Generating your own javadocs also has the huge advantage that you know they are precisely the right javadocs for the JDK you are using on your system.
The same applies to documenting any and all Java .jars (with source) which you use. However, all versions of most jars will be found with their documentation available for download at Maven Central http://search.maven.org...
JavaFX API documentation
You could download the Mac 2.2 preview release from here and unzip it.
http://www.oracle.com/technetwork/java/javafx/downloads/devpreview-1429449.html
The Javadoc won't quite match 2.1, but it will be close and if you use the preview instead, it will match exactly.
For the download of latest java documentation(jdk-8u77) API
Navigate to http://www.oracle.com/technetwork/java/javase/downloads/index.html
Under Addition Resources and Under Java SE 8 Documentation
Click Download button
Under Java SE Development Kit 8 Documentation > Java SE Development Kit 8u77 Documentation
Accept the License Agreement and click on the download zip file
Unzip the downloaded file
Start the API docs from
jdk-8u77-docs-all\docs\api\index.html
For the other java versions api download, follow the following steps.
Navigate to http://docs.oracle.com/javase/
From Release dropdown select either of Java SE 7/6/5
In corresponding JAVA SE page and under Downloads left side menu
Click JDK 7/6/5 Documentation or Java SE Documentation
Now in next page select the appropriate Java SE Development Kit 7uXX Documentation.
Accept License Agreement and click on Download zip file
Unzip the file and Start the API docs from
jdk-7uXX-docs-all\docs\api\index.html
The updated latest version of "The Java language Specification" can be found via the following links.
Java 7
Java 8
For example, Java Platform Standard Edition 7 Documentation has a link to download "JDK 7 Documentation" in the sidebar under "Downloads". I'd expect the same for other versions.

Problem with java-doc for standard java library

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.

JDK documentation in IntelliJ IDEA on Mac OS X

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

Categories

Resources