eagertoLearn eagertoLearn - 3 years ago 159
Java Question

how to import source code into Eclipse from a jar file?

I got a

file that is packaged with
source code
in it. I want to load it as a top-level project and start working on the source code. How can I do that in Eclipse?

For example: if I have helloworld.jar, when I import this jar. I want to have the project name as helloworld, with all the packages and src inside it.

I do not want that code on build path.but on my IDE to work with.

Answer Source

Create a directory named "helloworld" and unpack the JAR into that directory:

mkdir helloworld
cd helloworld
jar xvf ../helloworld.jar

You can then create a project from existing sources and start operating on that. I don't think Eclipse will let you create a project and change files directly in the JAR.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download