0

Eclipse is a very useful IDE for java and I find programming with it far more convenient than just using NPP and the command line. However the project structure of Eclipse is very inconvenient for a project that is going to be compiled and run outside of the Eclipse IDE (like an assignment that must be turned in as source code). Is there anyway to use eclipse to edit (and hopefully run) java code that exists in a more simple directory structure such as:

/MyProject
    /Code.java
    /MoreCode.java
    /data.txt
Kevin Klute
  • 450
  • 1
  • 4
  • 22
  • 1
    If you want the features of eclipse(Eg: ctrl + click to view definition in other class). you should make it as a eclipse project, else that would be a individual file edited similar in a notepad. – Viswanath Lekshmanan Dec 07 '15 at 04:37

1 Answers1

1

You need to convert it as a project, because in other case it will not provide you all Eclipse features. Easiest method to convert it:

1) Put all source files into one directory named after your project. i.e. "ProjectName". You can keep this directory in your workspace or it can be somewhere else.

2) Start a new project in eclipse and name it using that same project name.

3) Uncheck the "use default location" box and find the directory where your project is unless your project is already in the workspace - then you must not uncheck the "use default location" box

4) Click 'next'.

5) Optionally this answer provides some information on making the Eclipse representation of the folder look more like the actual folder (remove 'JRE' from view).

That's it.

P.s Beware that if your source is already in the default location and you uncheck "use default location" and browse to your folder, eclipse will complain that there is already a project there and not allow you to proceed.

Community
  • 1
  • 1
m.aibin
  • 3,528
  • 4
  • 28
  • 47