user93353
user93353

Reputation: 14039

Creating a Java Project out of existing sources

I have some source files for a Java Project (the output is a jar file).

I have several source directories. I have a properties file, I have a manifest file, and an image directory.

I am able to compile all the java sources from the command line & then able to recreate the jar file by adding the class files, manifest, properties file & the image directory.

However, I want to create a Eclipse project out of these for debugging purposes. How do I go about doing this?

Upvotes: 0

Views: 2343

Answers (2)

Noushad
Noushad

Reputation: 512

Its possible in almost all the IDEs. Please follow the below steps to achieve this in eclipse.

  1. Create a new Project (Or if there's an existing project)
  2. In the package explorer, select the project, right-click then properties
  3. In the java build path click on source tab
  4. click the Link Source button
  5. In the linked folder location,paste the path to your source code or select by clicking Browse
  6. click finish
  7. do steps 4 to 6 until all the source folders are added.
  8. click ok

This will make your project to use multiple source folder.

Upvotes: 1

Veeresh123
Veeresh123

Reputation: 87

Case 1 : When extracted project was use in eclipse before

Extract the jar file into a separate folder

and make the folder as a workspace for eclipse.

And open eclipse

right click

import

enter image description here

And go for next and finish

Case 2 : When extracted project was not used in eclipse before

Extract the jar file into a separate folder

Create a new project

Copy the java from extracted folder to new created project with same package in src

Then build the projecct

enter image description here

Upvotes: 0

Related Questions