简体   繁体   中英

How to make JEE6 javadoc work for a regular JavaSE project in NetBeans 7.0.1?

All I want is for JavaEE6 documentation to show in my JavaSE project. Maybe it's not possible.

The problem is that I created a plain old JavaSE project (ie New Project -> Java -> 'Java Application' ) in NetBeans but I have Java Enterprise Edition elements in it.

One of these elements is the javax.persistence @Basic(fetch/optional) annotation.

- When I press on this annotation, NetBeans says ' Javadoc not found. 时,NetBeans说' 找不到Javadoc。 '. When I use ( Right-Click->'Show Javadoc' ), the status bar says: ' Cannot perform Show Javadoc here .'. 右键单击 - >'显示Javadoc' )时,状态栏显示 :' 无法在此处执行显示Javadoc '。

Extra info:

1) netbeans_installation_dir\\NetBeans 7.0.1\\enterprise\\docs contains the right API documentation zip file ( ). )。

2) I looked around on stackoverflow for similar solutions but they did not work for me - adding the to the library via the 'Tools -> Java Platforms -> Javadoc tab' doesn't work neither. 到库中通过'工具 - > Java平台 - > Javadoc选项卡'都不起作用。

Very strangely enough when I add the javaEE6.jar to the Javadoc tab of the JDK6 platform and in the Project structure window I right click on the ' JDK1.6 ' library with 'Show Javadoc', a browser window opens and I get to see JEE6 documentation like I wanted.

I'm guessing the problem is that I have a regular JavaSE project and NetBeans can't pick up the JavaEE6 javadoc because it doesn't know my app is partially using EE elements. It's probably also because that documentation is meant for JavaEE6 applications (that's why it's under the /enterprise folder).

So I don't know how to fix this. Is it a bug? (I read on a NetBeans bug report that this could be a possible bug).

This looks like to be a issue with how you are attaching the library to you project. The easiest way to do this, is using the libraries available at Tools > Libraries. You just need to make sure the library you are attaching to your project has the correct Javadoc attached too. If the Javadoc is not attached, you can try the following steps to do this:

  1. In the NetBeans IDE, go to "Tools > Libraries".
  2. Select the correct library and choose the Javadoc tab.
  3. Click "Add ZIP/Folder" and browse to where your project Javadoc is located.
  4. Specify the Javadoc ZIP or folder and click "Add ZIP/Folder".
  5. Click "OK" to close the Library Manager.

More details can be found at [this NetBeans Wiki page][1].

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM