如何将 Netbeans 项目转移到 Eclipse 中?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2122633/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 14:20:34  来源:igfitidea点击:

How to transfer Netbeans Project into Eclipse?

javaeclipseswingnetbeans

提问by Yatendra Goel

I have been using Netbeans for my java desktop application since few months. Now in the middle of the project, I want to switch over to Eclipse as the Netbeans once corrupted my GUI and I had to re-create several parts of the GUI and now it is displaying a compiler error as

几个月以来,我一直在将 Netbeans 用于我的 Java 桌面应用程序。现在在项目中间,我想切换到 Eclipse,因为 Netbeans 曾经损坏了我的 GUI,我不得不重新创建 GUI 的几个部分,现在它显示一个编译器错误

code too large
private void initComponents() {
1 error

"code too large" is a strange error. My code which it is saying too large is just 10,000 lines long. I came to know first time that we couldn't develop long code in Netbeans :)

“代码太大”是一个奇怪的错误。我说太大的代码只有 10,000 行。我第一次知道我们不能在 Netbeans 中开发长代码 :)

So instead of going into detail, I want to switch to Eclipse. I have never used it before. So could please tell me how to import my incompleted Netbeans project into eclipse.

因此,我不想详细介绍,而是想切换到 Eclipse。我以前从未使用过它。所以请告诉我如何将我未完成的 Netbeans 项目导入到 eclipse 中。

采纳答案by JRL

I dont' know if there exists a plugin for that, but if you've used default Netbeans settings it's likely the GUI layout code and form files won't be compatible.

我不知道是否存在一个插件,但是如果您使用了默认的 Netbeans 设置,则 GUI 布局代码和表单文件可能不兼容。

What I suggest you do is first refactor your existing code to eliminate Netbeans-specific features, as well as making it smaller, and working.

我建议您首先重构现有代码以消除特定于 Netbeans 的功能,并使其更小,并且可以正常工作。

For GUI-stuff, you should create several classes and beans so that your main GUI file is much-much smaller. 10000 lines of GUI code is pretty much unmanageable.

对于 GUI 的东西,您应该创建多个类和 bean,以便您的主 GUI 文件小得多。10000 行 GUI 代码几乎无法管理。

回答by bertolami

I suppose your main concern is migrate the GUI builder stuff, not only your code. The latter would be no problem but I guess that the first one is difficult if not impossible. And furthermore, as far as I know there is no standard GUI builder application in eclipse.

我想您主要关心的是迁移 GUI 构建器的东西,而不仅仅是您的代码。后者没有问题,但我想如果不是不可能的话,第一个是困难的。此外,据我所知,eclipse 中没有标准的 GUI 构建器应用程序。

回答by Craig

This should be resolved by spitting things up like others have said.

这应该通过像其他人所说的那样吐槽来解决。

I just got a similar error and NetBeans was struggling with the code so I just tried to compile it on the command line with javac and it yelled at me with this same error. So this is not an IDE issue but a Java compiler issue.

我刚刚遇到了一个类似的错误,NetBeans 正在努力处理代码,所以我只是尝试在命令行上使用 javac 编译它,但它以同样的错误对我大喊大叫。所以这不是 IDE 问题,而是 Java 编译器问题。

If you get this error you probably auto-generated most of your code.

如果您收到此错误,您可能会自动生成大部分代码。

回答by Aadith Ramia

the easiest thing to do would be to create a new project in eclipse and import the codebase from filesystem into the project. Eclipse has an option to import from filesystem.

最简单的方法是在 eclipse 中创建一个新项目并将代码库从文件系统导入到项目中。Eclipse 有一个从文件系统导入的选项。