How do you open a Java open source project in an IDE

S

Sathyaish

Pardon my nescience if the title of the question makes me sound like a
nincompoop.

With Microsoft's .NET platform, there are only a handful of IDE's, most
proprietary, with Microsoft Visual Studio .NET 200x dominating the
market. As a result, if I download a C# project/source code from the
Web, I am almost sure it would have a Microsoft Visual Studio .NET
'Solution' file (.sln) or 'Project' file (.csproj). If it does, I open
the file to launch the project within Visual Studio.

If not, it is very likely that the project would have a
project/solution file of one of the other 2 or 3 available IDE's for
..NET -- SharpDevelop, Eclipse (has a plugin), and that's it.

However, with Java, since I am a newbie in the vast kingdom of Java, I
feel a bit lost when I download Java source code from the Web. For
instance, I just downladed apache's (ASF's) log4j. Most of the projects
in Java just have the .java and .class files. They do not have an IDE
file associated, for instance, a .ipr file for IntelliJ IDEA or
something. I can understand that it is so because there are many more
IDE's, most of them open source for Java, even if they're not that good
(EditPlus, IntelliJ (which is not open source) IDEA, NetBeans, Eclipse,
WSAD etc.).

My question is, when I get a folder of source Java code, with a
multi-level folder heirarchy within that, containing only .java files,
how do I open that in an IDE ensuring that the heirarchy of the files
and packages is maintained?
 
C

ck

Sathyaish said:
My question is, when I get a folder of source Java code, with a
multi-level folder heirarchy within that, containing only .java files,
how do I open that in an IDE ensuring that the heirarchy of the files
and packages is maintained?

I simply import the source code into a blank project (in case I am
using eclipse. I create a new java project, with project same as the
source code that I would like to view).
One more thing that you can do in Eclipse is create classpath
variables(windows>preferences>java> build path> Class Path Variables)
Click on new and add the binary (for example jar file of log4j) and
include this variable in your project. To this variable you can attach
the source code which would be a zip file generally.
Here after it would be very easy for you to look at the code.

Hope this helps.

Cheers,
Ck
http://www.gfour.net
 
A

Andrew Thompson

Sathyaish said:
Pardon my nescience if the title of the question makes me sound like a
nincompoop.

That's OK. The title made you sound like a nincompoop,
but your use of the word 'nescience' makes you sound like
an arrogant prat - so it all balances out (shrugs).
....I just downladed apache's (ASF's) log4j. Most of the projects
in Java just have the .java and .class files.

Are you saying the log4j source distributable failed to
include a build.xml file? Most Java based projects these
days come with one, because..*
...I can understand that it is so because there are many more
IDE's, most of them open source for Java, even if they're not that good..

There, there. There, there.
(EditPlus, IntelliJ (which is not open source) IDEA, NetBeans, Eclipse,
WSAD etc.).

My question is, when I get a folder of source Java code, with a
multi-level folder heirarchy within that, containing only .java files,
how do I open that in an IDE ensuring that the heirarchy of the files
and packages is maintained?

* ..most (if not all) of those IDE's understand ant
based build files.

Andrew T.
 
D

Daniel Dyer

My question is, when I get a folder of source Java code, with a
multi-level folder heirarchy within that, containing only .java files,
how do I open that in an IDE ensuring that the heirarchy of the files
and packages is maintained?

Is there a file called build.xml? Most open source projects will provide
this file so that they can be built using Ant, which is pretty much the de
facto standard for building Java projects. IDEs such as NetBeans can
import build.xml and configure sensible defaults for the project.

You shouldn't have any problems maintaing the heirarchy. Usually you can
just point the IDE at the root of the source tree.

Dan.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top