如何将您的Netbeans项目导入Eclipse

时间:2023-02-05 18:05:49

I want to get my NetBeans project to Eclipse. It's a web application project.

我想将我的NetBeans项目引入Eclipse。这是一个Web应用程序项目。

I imported war files into Eclipse but I am not able to get the Java files and the war files are giving me many errors. What is the best way to import the whole project?

我将war文件导入Eclipse但我无法获取Java文件,war文件给我带来了很多错误。导入整个项目的最佳方法是什么?

5 个解决方案

#1


24  

One other easy way of doing it would be as follows (if you have a simple NetBeans project and not using maven for example).

另一种简单的方法是(如果你有一个简单的NetBeans项目,而不是使用maven)。

  1. In Eclipse, Go to File -> New -> Java Project
  2. 在Eclipse中,转到文件 - >新建 - > Java项目
  3. Give a name for your project and click finish to create your project
  4. 为项目命名,然后单击“完成”以创建项目
  5. When the project is created find the source folder in NetBeans project, drag and drop all the source files from the NetBeans project to 'src' folder of your new created project in eclipse.
  6. 创建项目时,在NetBeans项目中找到源文件夹,将所有源文件从NetBeans项目拖放到eclipse中新创建的项目的'src'文件夹中。
  7. Move the java source files to respective package (if required)
  8. 将java源文件移动到相应的包(如果需要)
  9. Now you should be able to run your NetBeans project in Eclipse.
  10. 现在,您应该能够在Eclipse中运行NetBeans项目。

#2


11  

Sharing my experience, how to import simple Netbeans java project into Eclipse workspace. Please follow the following steps:

分享我的经验,如何将简单的Netbeans java项目导入Eclipse工作区。请按照以下步骤操作:

  1. Copy the Netbeans project folder into Eclipse workspace.
  2. 将Netbeans项目文件夹复制到Eclipse工作区。
  3. Create .project file, inside the project folder at root level. Below code is the sample reference. Change your project name appropriately.

    在根级别的项目文件夹中创建.project文件。下面的代码是示例参考。适当更改项目名称。

    <?xml version="1.0" encoding="UTF-8"?>
    <projectDescription>
        <name>PROJECT_NAME</name>
        <comment></comment>
        <projects>
        </projects>
        <buildSpec>
            <buildCommand>
                <name>org.eclipse.jdt.core.javabuilder</name>
                <arguments>
                </arguments>
            </buildCommand>
        </buildSpec>
        <natures>
            <nature>org.eclipse.jdt.core.javanature</nature>
        </natures>
    </projectDescription>
    
  4. Now open Eclipse and follow the steps,

    现在打开Eclipse并按照步骤操作,

    File > import > Existing Projects into Workspace > Select root directory > Finish

    文件>导入>现有项目到工作区>选择根目录>完成

  5. Now we need to correct the build path for proper compilation of src, by following these steps:

    现在我们需要通过以下步骤来纠正正确编译src的构建路径:

    Right Click on project folder > Properties > Java Build Path > Click Source tab > Add Folder

    右键单击项目文件夹>属性> Java构建路径>单击“源”选项卡>“添加文件夹”

(Add the correct src path from project and remove the incorrect ones). Find the image ref link how it looks.

(从项目添加正确的src路径并删除不正确的src路径)。找到图像参考链接的外观。

  1. You are done. Let me know for any queries. Thanks.
  2. 你完成了。如有任何疑问,请与我联系。谢谢。

#3


6  

You should be using Maven, as the structure is standardized. To do that (Once you have created your Maven project in Netbeans, just

你应该使用Maven,因为结构是标准化的。要做到这一点(一旦你在Netbeans中创建了Maven项目,就行了

  1. Go to File -> Import
  2. 转到文件 - >导入
  3. Open Maven tree node
  4. 打开Maven树节点
  5. Select Existing Maven Project
  6. 选择现有Maven项目
  7. Browse to find your project from NetBeans
  8. 浏览以从NetBeans中查找项目
  9. Check Add project to Working Set
  10. 选中“将项目添加到工作集”
  11. Click finish.
  12. 点击完成。

As long as the project has no errors, I usually get none transferring to eclipse. This works for Maven web projects and regular projects.

只要项目没有错误,我通常都没有转移到eclipse。这适用于Maven Web项目和常规项目。

#4


3  

There's a very easy way if you were using a web application just follow this link.

如果您使用Web应用程序,只需按照此链接即可轻松实现。

just do in eclipse :

只是在日食中做:

File > import > web > war file

Then select the war file of your app :)) very easy !!

然后选择你的应用程序的战争文件:))非常容易!

#5


1  

  1. Make sure you have sbt and run sbt eclipse from the project root directory.
  2. 确保你有sbt并从项目根目录运行sbt eclipse。
  3. In eclipse, use File --> Import --> General --> Existing Projects into Workspace, selecting that same location, so that eclipse builds its project structure for the file structure having just been prepared by sbt.
  4. 在eclipse中,使用File - > Import - > General - > Existing Projects into Workspace,选择相同的位置,以便eclipse为刚刚由sbt编写的文件结构构建其项目结构。

#1


24  

One other easy way of doing it would be as follows (if you have a simple NetBeans project and not using maven for example).

另一种简单的方法是(如果你有一个简单的NetBeans项目,而不是使用maven)。

  1. In Eclipse, Go to File -> New -> Java Project
  2. 在Eclipse中,转到文件 - >新建 - > Java项目
  3. Give a name for your project and click finish to create your project
  4. 为项目命名,然后单击“完成”以创建项目
  5. When the project is created find the source folder in NetBeans project, drag and drop all the source files from the NetBeans project to 'src' folder of your new created project in eclipse.
  6. 创建项目时,在NetBeans项目中找到源文件夹,将所有源文件从NetBeans项目拖放到eclipse中新创建的项目的'src'文件夹中。
  7. Move the java source files to respective package (if required)
  8. 将java源文件移动到相应的包(如果需要)
  9. Now you should be able to run your NetBeans project in Eclipse.
  10. 现在,您应该能够在Eclipse中运行NetBeans项目。

#2


11  

Sharing my experience, how to import simple Netbeans java project into Eclipse workspace. Please follow the following steps:

分享我的经验,如何将简单的Netbeans java项目导入Eclipse工作区。请按照以下步骤操作:

  1. Copy the Netbeans project folder into Eclipse workspace.
  2. 将Netbeans项目文件夹复制到Eclipse工作区。
  3. Create .project file, inside the project folder at root level. Below code is the sample reference. Change your project name appropriately.

    在根级别的项目文件夹中创建.project文件。下面的代码是示例参考。适当更改项目名称。

    <?xml version="1.0" encoding="UTF-8"?>
    <projectDescription>
        <name>PROJECT_NAME</name>
        <comment></comment>
        <projects>
        </projects>
        <buildSpec>
            <buildCommand>
                <name>org.eclipse.jdt.core.javabuilder</name>
                <arguments>
                </arguments>
            </buildCommand>
        </buildSpec>
        <natures>
            <nature>org.eclipse.jdt.core.javanature</nature>
        </natures>
    </projectDescription>
    
  4. Now open Eclipse and follow the steps,

    现在打开Eclipse并按照步骤操作,

    File > import > Existing Projects into Workspace > Select root directory > Finish

    文件>导入>现有项目到工作区>选择根目录>完成

  5. Now we need to correct the build path for proper compilation of src, by following these steps:

    现在我们需要通过以下步骤来纠正正确编译src的构建路径:

    Right Click on project folder > Properties > Java Build Path > Click Source tab > Add Folder

    右键单击项目文件夹>属性> Java构建路径>单击“源”选项卡>“添加文件夹”

(Add the correct src path from project and remove the incorrect ones). Find the image ref link how it looks.

(从项目添加正确的src路径并删除不正确的src路径)。找到图像参考链接的外观。

  1. You are done. Let me know for any queries. Thanks.
  2. 你完成了。如有任何疑问,请与我联系。谢谢。

#3


6  

You should be using Maven, as the structure is standardized. To do that (Once you have created your Maven project in Netbeans, just

你应该使用Maven,因为结构是标准化的。要做到这一点(一旦你在Netbeans中创建了Maven项目,就行了

  1. Go to File -> Import
  2. 转到文件 - >导入
  3. Open Maven tree node
  4. 打开Maven树节点
  5. Select Existing Maven Project
  6. 选择现有Maven项目
  7. Browse to find your project from NetBeans
  8. 浏览以从NetBeans中查找项目
  9. Check Add project to Working Set
  10. 选中“将项目添加到工作集”
  11. Click finish.
  12. 点击完成。

As long as the project has no errors, I usually get none transferring to eclipse. This works for Maven web projects and regular projects.

只要项目没有错误,我通常都没有转移到eclipse。这适用于Maven Web项目和常规项目。

#4


3  

There's a very easy way if you were using a web application just follow this link.

如果您使用Web应用程序,只需按照此链接即可轻松实现。

just do in eclipse :

只是在日食中做:

File > import > web > war file

Then select the war file of your app :)) very easy !!

然后选择你的应用程序的战争文件:))非常容易!

#5


1  

  1. Make sure you have sbt and run sbt eclipse from the project root directory.
  2. 确保你有sbt并从项目根目录运行sbt eclipse。
  3. In eclipse, use File --> Import --> General --> Existing Projects into Workspace, selecting that same location, so that eclipse builds its project structure for the file structure having just been prepared by sbt.
  4. 在eclipse中,使用File - > Import - > General - > Existing Projects into Workspace,选择相同的位置,以便eclipse为刚刚由sbt编写的文件结构构建其项目结构。