如何在NetBeans中引用库? [英] How do I reference libraries in NetBeans?

查看:543
本文介绍了如何在NetBeans中引用库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在旧版本的NetBeans中创建的Java Web Services项目,我在几个月内没有访问它,所以我的路径和已安装的库是不同的。

I have a Java Web Services project that was created in an older version of NetBeans, and I haven't accessed it in many months, so my paths and installed libraries are different.

当我尝试打开项目时,出现Resolve Reference Problems对话框,列出了两个参考问题:

When I try to open the project, I get a "Resolve Reference Problems" dialog, and two Reference Problems are listed:

"metro" library could not be found
"JAX-WS-ENDORSED" library could not be found

我有一个全新的带有NetBeans 7.0的JDK 6 Update 25 ,我正在运行Windows 7.

I have a fresh installation of JDK 6 Update 25 with NetBeans 7.0, and am running Windows 7.

我可以采取哪些步骤来解决这个问题?我甚至都不知道从哪里开始,因为我到目前为止采取的每一种方法都没有让我到任何地方。

What steps can I take to solve this? I don't even know where to start, as every approach I've taken so far hasn't gotten me anywhere.

注意: JAX-WS-ENDORSED没有出现在我的库列表中,因此我无法将其删除。隐藏的东西正在引用它。我怎么会发现这个?

Note: JAX-WS-ENDORSED does not appear in my Libraries listing, so I can't remove it. Something hidden is referencing it. How would I find this?

推荐答案

我刚遇到这个问题并从 http://netbeans.org/bugzilla/show_bug.cgi?id=187145 。显然,Netbeans将在创建新的Web服务时创建JAX-WS-ENDORSED库。因此,请转到文件>新文件,选择Web服务> Web服务客户端并填写虚拟值(这可以在一次性项目中完成)。然后可以删除此客户端,Netbeans将使用以下类路径条目创建库:

I just came across this issue and found some help from http://netbeans.org/bugzilla/show_bug.cgi?id=187145. Apparently, Netbeans will create the JAX-WS-ENDORSED library when a new web service is created. So go to File > New File, choose Web Service > Web Service Client and fill in dummy values (this can be done in a throwaway project). This client can then be removed, and Netbeans will have created the library with the following classpath entries:

java/modules/ext/jaxws22/api/jaxws-api.jar
ide/modules/ext/jaxb/api/jaxb-api.jar

这些是相对于您的Netbeans安装目录(在OS X上将位于.app内的Contents / Resources / Netbeans中)。或者,您可以使用上面的条目手动创建库。

These are relative to your Netbeans install directory (on OS X will be located in Contents/Resources/Netbeans within the .app). Alternatively, you could create the library manually using the entries above.

这只需要执行一次,因为库将添加到Netbeans Global Libraries列表中。

This only needs to be done once, as the library will be added to Netbeans Global Libraries list.

这篇关于如何在NetBeans中引用库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆