如何使用 Netbeans 打开非 Netbeans Java 项目?
我使用 Netbeans 进行 Java 开发,每次下载使用其他 IDE 开发的项目时,我都会因为错误而无法运行该项目。
有没有什么方法可以轻松地打开普通人的项目而不头痛。 注意:我尝试打开的项目不是 Eclipse 项目,因此我无法使用 Eclipse 导入器。
而Java开发者通常使用什么来进行开发呢?
I'm using Netbeans for my Java development, and every time I download a project that has been developed using other IDE, I can't run the project because of errors.
Is there any way to open regular people's projects easily without headache.
Note : the project am trying to open is not an Eclipse project, so I can't use the Eclipse importer.
And usually what are Java developers using for development?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
大多数 Java 开发人员都分为 Eclipse、IntelliJ Idea 和 NetBeans。 NetBeans 能够打开 Eclipse 项目,Idea 可以导出到 Eclipse。所以这应该可以解决大多数问题。
另一种方法是检查您的项目是否使用 Maven 或类似模型。一般来说,Netbeans 有一些插件可以处理来自此类来源的导入。
Most Java developers are split between Eclipse , IntelliJ Idea and NetBeans. NetBeans is capable of opening Eclipse projects and Idea can export to Eclipse. So this should solve most problems.
Another way is to check if you project is using Maven or a similar model. Generally there are plugins for Netbeans that can handle import from this sort of sources.
我使用
File > 运气不错。新项目...>爪哇>具有现有源代码的 Java 项目
,“将现有 Java 应用程序导入到标准 IDE 项目中。Java 应用程序可以有多个源文件夹。标准项目使用 IDE 生成的 Ant 构建脚本来构建、运行和调试您的项目。”方便的是,生成的脚本包含可以覆盖以改变构建过程的目标,如此处所示。I've had some luck using
File > New Project… > Java > Java Project with Existing Sources
, which "Imports an existing Java application into a standard IDE project. The Java application can have multiple source folders. Standard projects use an IDE-generated Ant build script to build, run, and debug your project." Conveniently, the generated script includes targets that can be overridden to alter the build process, as seen here.我们有几个项目使用现有的 ant 构建脚本,而我想要的只是将 NetBeans 作为我的代码编辑器......到目前为止。
我们的目标是项目独立于 IDE,因为我们过去只使用 emacs 和 ant 进行编码/构建,这意味着独立于平台,您应该能够签出代码并构建它,无论它是否在IDE 或只是一个 shell/“DOS 提示符”。如果您有类似的项目,请使用“Java 自由形式项目”,并将您在构建脚本中定义的所有 jar 添加到 Netbeans CLASSPATH 中。
这种类型的项目将使用您的 ant 脚本来完成所有事情,并且即使您项目中的某人更喜欢使用其他编码环境,它仍然可以工作。
希望这可以帮助
We have several projects with existing ant build scripts and all I want is to have NetBeans as my code editor ...so far.
We aim for that the projects are independent of IDE as we have been used to just use emacs and ant for coding/building, which means that independant on platform you should be able to checkout the code and just build it no matter if it is within an IDE or just a shell/"DOS prompt". If you have projects like that use the "Java Free-Form project" and add all jars that you have defined in build script to also be included in Netbeans CLASSPATH.
This type of project will use your ant scripts for everything and will still work even if someone in your project prefer to use other coding environment.
Hope this can help