共享一个Netbeans项目 [英] Sharing a Netbeans project

查看:118
本文介绍了共享一个Netbeans项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用Netbeans开发的Java项目.因为我是唯一的开发人员,并且它是一个简单的项目(一个源文件,但是需要几个专业库),所以我没有使用源代码控制.

I have a java project that I developed in Netbeans. Because I was the only developer and it's a simple project (one source file, but it needs several specialty libraries) I didn't use source control.

我将不再从事该项目,并且希望将其移交给其他人,以防将来他们需要对其进行更改.我认为仅压缩项目文件夹并将其发送给她是不够的,因为该项目指向我计算机上其他位置(多个位置)的库.有没有一种方法可以指示Netbeans创建项目的可共享副本,其中包括所有库的副本以及所需的指针? (在dist/lib中有这些库的副本,但是我很确定在构建项目时Java不在这里寻找它们.)

I'm no longer going to be working on the project, and want to hand it over to someone else in case they need to make changes to it in the future. I don't think it will be sufficient to just zip up the project folder and send it to her, as the project points to libraries located elsewhere (multiple locations) on my computer. Is there a way to direct Netbeans to create a shareable copy of the project that would include copies of all the libraries, with the required pointers? (There are copies of the libraries in dist/lib, but I'm pretty sure that's not where Java looks for them when building the project.)

File菜单中的Export Project -> to ZIP可以在这里做什么吗?

Would Export Project -> to ZIP from the File menu do what I need here?

推荐答案

如果要导出项目,以便可以从NetBeans IDE重新打开该项目,则:

If you want to export the project so that it will be reopened from a NetBeans IDE:

  • 右键单击您的项目,然后选择创建一个新文件夹.将其命名为lib,然后按OK.如果转到Files选项卡,您将能够看到该文件夹​​.

  • Right click your project and choose to create a new folder. Name it lib and press OK. You will be able to see the folder if you go to the Files tab.

然后将您的库放在那里(复制).

Then put (copy) your libraries there.

然后返回项目"选项卡,然后右键单击库"节点.选择添加JAR/文件夹,然后指向您要使用的jar所在的位置(在lib文件夹中).选择文件,并确保选择引用为:相对路径"选项.单击打开.

Then go back to projects tab and right click the libraries node. Choose add JAR/Folder and point to where your jar you want to use is (inside the lib folder). Select the file and also make sure that you choose the Reference as: Relative Path option. Click open.

现在,如果您扩展项目的"libraries"节点,您将能够看到您的库.

You will now be able to see your library if you expand the libraries node of your project.

选择您的项目,然后从文件菜单中选择Export project to ZIP.

Select your project and then choose Export project to ZIP from the file menu.

就这样.

如果解压缩创建的zip文件,您将看到lib文件夹,其中包含所有JAR文件.另外,如果您转到nbproject并打开文件project.properties,您将看到一些行,如file.reference.dom4j-1.6.1.jar=lib\\dom4j-1.6.1.jar.我相信Netbeans就是这样知道在哪里可以找到您需要的库的.

If you extract the created zip file you will see the lib folder with all the JAR files in it. Also if you go to the nbproject and open the file project.properties you will see some lines like file.reference.dom4j-1.6.1.jar=lib\\dom4j-1.6.1.jar. I believe this is how Netbeans knows where to find the libraries you need.

如果要迁移到Eclipse: http://www. coderanch.com/t/458555/vc/Export-Netbeans-Eclipse

If you want to migrate to Eclipse: http://www.coderanch.com/t/458555/vc/Export-Netbeans-Eclipse

如果要通用,则应使用MavenAnt构建项目.每个现代的IDE(Eclipse,NetBeans,InteliJ)都可以理解这些构建工具.

If you want to be general then you should build your project with Maven or Ant. Every modern IDE (Eclipse,NetBeans,InteliJ) can understand these building tools.

希望它对您有帮助.

这篇关于共享一个Netbeans项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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