Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get your Netbeans project into Eclipse

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

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?

like image 893
XXDebugger Avatar asked Feb 03 '14 18:02

XXDebugger


People also ask

How do I export a project from NetBeans to Java?

You can use Files>Export>Browse to Export in netbeans.

Is Eclipse IDE better than NetBeans?

Answer: Both Eclipse and NetBeans are the best IDEs used in order to develop Java applications. When developers are new to the development environment, a single view for all the types of applications, with a build-in plug-in for many functionalities and a stable framework of NetBeans IDE, is preferred.

Is NetBeans and Eclipse the same?

Eclipse and Netbeans are both free, open source IDEs. Both support multiple languages, but are especially well-suited for Java. The same basic functionality is available in both Eclipse and NetBeans. But each one has its pros and cons.


2 Answers

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

  1. In Eclipse, Go to File -> New -> Java Project
  2. Give a name for your project and click finish to create your project
  3. 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.
  4. Move the java source files to respective package (if required)
  5. Now you should be able to run your NetBeans project in Eclipse.
like image 187
moinul islam Avatar answered Oct 17 '22 14:10

moinul islam


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

  1. Copy the Netbeans project folder into Eclipse workspace.
  2. Create .project file, inside the project folder at root level. Below code is the sample reference. Change your project name appropriately.

    <?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>
    
  3. Now open Eclipse and follow the steps,

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

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

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

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

  1. You are done. Let me know for any queries. Thanks.
like image 13
Santosh Mondal Avatar answered Oct 17 '22 13:10

Santosh Mondal