This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Sometimes, I cannot view the source for JDK classes in my selected Java Platform in NetBeans 7.1 RC 2; when I open a class from the JDK (e.g., java.lang.Integer), it shows me a generated source file instead of the actual source in src.zip, even though src.zip is correctly referenced by the Java Platform (at least according to the Java Platforms dialog). When this problem occurs, it occurs for all Java Platform classes (e.g., if java.lang.Integer's source is not found, then source is also not found for any other JDK class). If I attempt to re-associate the correct src.zip file with my Java Platform via the Attach Sources... button in the top right corner of the generated code editor, nothing changes. Sometimes, however, the source is correctly found. Sometimes, source is not found, but later, without having restarted NetBeans, source starts to be found again. I have not yet isolated what fixes the issue. I'm running NetBeans on JDK 7u2 x64 (on Windows 7 x64 with all the latest updates), which is also my default & only Java Platform in NetBeans (except for the Default JavaFX Platform that was also created by NetBeans upon its installation). As previously mentioned, this Java Platform correctly points to my JDK's src.zip file. Both of my two open projects use this exact JDK 7u2 platform. I am always able to view source for classes in libraries & projects. In NetBeans 7.1 Beta 1, I was always able to see source for the JDK classes. Thanks.
It occurs to me too in official 7.1 release. The src.zip jdk source file is correctly linked to the jdk under the Java platforms popup, yet no source can be shown. Moreover, every javadoc popup seems to be downloaded form the web, so there's a major issue here. Everything worked fine in 6.9.1 and 7.0.1, and I did nothing else than installing 7.1 (may be important: I told the installer to use the configuration file from 7.0.1).
Additional info: I just removed the javadoc url from the "javadoc" tab in the Java Platform Manager, and everything works like a charm now. The issue is definitely here. (In reply to comment #1) > It occurs to me too in official 7.1 release. > The src.zip jdk source file is correctly linked to the jdk under the Java > platforms popup, yet no source can be shown. > > Moreover, every javadoc popup seems to be downloaded form the web, so there's a > major issue here. > > Everything worked fine in 6.9.1 and 7.0.1, and I did nothing else than > installing 7.1 (may be important: I told the installer to use the configuration > file from 7.0.1).
Do you still have the platform definition file for which the go to source did not work?
Here it is. Note that I just had to add the javadoc url back (by using the java Platform Manager ui) to break Netbeans again, and prevent it from being able to correctly fetch the src.zip file. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE platform PUBLIC "-//NetBeans//DTD Java PlatformDefinition 1.0//EN" "http://www.netbeans.org/dtds/java-platformdefinition-1_0.dtd"> <platform default="yes" name="JDK 1.7 (Default)"> <properties> <property name="platform.ant.name" value="default_platform"/> </properties> <javadoc> <resource>http://docs.oracle.com/javase/7/docs/api/</resource> </javadoc> </platform> (In reply to comment #3) > Do you still have the platform definition file for which the go to source did > not work?
But there is no record for java sources. There should be <sources> element, something like: <platform default="yes" name="JDK 1.6 (Default)"> <properties> <property name="platform.ant.name" value="default_platform"/> </properties> <sources> <resource>jar:file:/Library/Java/JavaVirtualMachines/1.6.0_22-b04-307.jdk/Contents/Home/src.jar!/src/</resource> </sources> <javadoc> <resource>jar:file:/Library/Java/JavaVirtualMachines/1.6.0_22-b04-307.jdk/Contents/Home/src.jar!/</resource> </javadoc> </platform>
Interesting report: the only 3rd-party plugin I had installed was nbandroid (http://www.nbandroid.org/). I uninstalled it: "go to source" feature worked again like a charm. Then I reinstalled it: everything is still fine. There may have been a corruption due to the plugin, since it installs a new platform definition for Android. However, I still do not have a <sources> tag. I tried removing the src.zip file from the Java Platform Manager ui: "go to sources" does not find sources anymore. I added it back using the ui again: "go to sources" works normally, but <sources> tag is still absent from the xml file.
For default platform when the sources are on standard location the <sources> element is not written. The <sources> s not written because the default platform is dynamic, it's the platform you are running the IDE on. So it can change, when you change it the pass will be wrong. I will test it with the NB-Android and let you know.
Also isn't the project from where you cannot navigate to JDK broken (broken reference to JDK)? If you can reproduce please open properties for file you navigated from and attach the boot classpath + platform definition file of platform owning the boot classpath. Thanks
*** Bug 206923 has been marked as a duplicate of this bug. ***
(In reply to comment #8) > Also isn't the project from where you cannot navigate to JDK broken (broken > reference to JDK)? > If you can reproduce please open properties for file you navigated from and > attach the boot classpath + platform definition file of platform owning the > boot classpath. > Thanks Take a look at bug 206923. I've reproduced this problem by editing one of my application classes, then CTRL+LMB click on IOException. What do you want me to do in that case? How do I get "properties" for the file I navigated from in this case? Another time I recall reproducing the problem by simply invoking CTRL+O (Go To Type) and typing the class name I wanted to view. Please let me know what information you want me to collect in these cases and I will do my best to do so the next time I reproduce the problem.
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue. Thanks for your cooperation, NetBeans IDE 8.2 Release Boss