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.

Bug 232084 - Can't utilize locally stored JavaDocs
Summary: Can't utilize locally stored JavaDocs
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 7.3.1
Hardware: Macintosh (x86) Mac OS X
: P3 normal with 1 vote (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on: 232142
Blocks:
  Show dependency tree
 
Reported: 2013-07-01 14:05 UTC by blake1024
Modified: 2013-07-06 02:02 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description blake1024 2013-07-01 14:05:52 UTC
Greetings,

I am running NetBeans 7.3 (with updates) on Mac OS/X.  I also verified this problem on 7.3.1.

I want to use my local copy of JavaDocs.  My copy is unzipped because I like to use it in a browser too.  It is unzipped under my home directory ~/JavaDocs

(For those unfamiliar with Unix, "~" means my home directory.)

So, I have api, images, index.html, jdk, jre, legal, platform, and technotes all under ~/JavaDocs.

Within NetBeans I go to Tools / Java Platforms.  There is only one JDK, JDK 1.6.

I go to JavaDoc tab, Add ZIP/Folder and browse to ~/JavaDocs, select it, and click "Add Zip/Folder".  Instead of seeing ~/JavaDocs in the NetBeans window, I see

         ~/JavaDocs/jre/api/security/smartcard/spec

I have no idea where it is getting that.  Naturally, JavaDocs doesn't work in NetBeans.  I can't figure out how to fix this (short of manually editing NetBeans XML files).  Every time I try deleting that path and putting in the correct path it acts as if I selected that crazy path.

Just FYI, ~/JavaDocs works perfectly from my browser and is unaltered from my unzip.
Comment 1 Tomas Zezula 2013-07-01 16:38:52 UTC
The JavaDocs is not a valid Javadoc root folder, so the NB tries to find out the nearest JavaDoc folder under the selected folder. In your case it's the ~/JavaDocs/jre/api/security/smartcard/spec which is not the javadoc for JDK. The correct javadoc folder is ~/JavaDocs/api if you unzipped the default apple JDK javadoc containing:

api
jdk
jre
platform

In the Java Platform Manager add the following javadoc root: ~/JavaDocs/api and everything will work fine.
Comment 2 blake1024 2013-07-01 17:01:13 UTC
Cool.  That works.  However, I still consider this a bug for the following reason.

How would I (or anyone else) have known what you said without your help or reading the source code?

If the directory selected is not a valid root directory the system should say so rather than choose some random sub-directory.  The error message should also indicate how to tell if it is a valid root directory, and it should suggest likely paths (like your response did).

I am changing the state back to REOPENED not to be obstinate or disrespectful but merely to request a second look at the problem.  I won't do it again.

Thanks!
Comment 3 Tomas Zezula 2013-07-01 17:43:28 UTC
In fact the problem is only with Apple's Javadoc bundle. The Oracle (Sun) Javadoc has single javadoc root and NB behaviour is exactly what user wants (he selects doc folder or jar and the IDE itself finds the correct root). The error message will make the usability worse as the user will be forced to select the correct root (api folder). As the Apple's JDK is deprecated and is replaced by Oracle  JDK 7 (Apple will not provide JDK 7) it's probably low priority.

A possible solution is to find all the javadoc roots under the selected folder (up to some depth). I will try to do it and if it does not affect the speed significantly I will integrate it.
Comment 4 blake1024 2013-07-01 18:08:49 UTC
Thanks.  The JavaDocs I am using were from Oracle Java 6 download and not part of the Mac.
Comment 5 Tomas Zezula 2013-07-01 18:34:37 UTC
Right, it seems that even the Oracle Javadoc now contains more roots.
Comment 6 Tomas Zezula 2013-07-02 12:35:37 UTC
Will take some time as an API extension was needed and API change process is required. For details see issue #232142.
Comment 7 Tomas Zezula 2013-07-04 16:47:48 UTC
Fixed jet-main 578bceffa02f
Comment 8 Quality Engineering 2013-07-06 02:02:57 UTC
Integrated into 'main-silver', will be available in build *201307052300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/578bceffa02f
User: Tomas Zezula <tzezula@netbeans.org>
Log: #232084:Can't utilize locally stored JavaDocs