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

Discussion in 'Java' started by Sathyaish, Jan 11, 2007.

  1. Sathyaish

    Sathyaish Guest

    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?
     
    Sathyaish, Jan 11, 2007
    #1
    1. Advertising

  2. Sathyaish

    ck Guest

    Sathyaish wrote:
    > 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
     
    ck, Jan 11, 2007
    #2
    1. Advertising

  3. Sathyaish wrote:
    > 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.
     
    Andrew Thompson, Jan 11, 2007
    #3
  4. Sathyaish

    Daniel Dyer Guest

    On Thu, 11 Jan 2007 11:14:25 -0000, Sathyaish <> wrote:

    > 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.

    --
    Daniel Dyer
    http://www.uncommons.org
     
    Daniel Dyer, Jan 11, 2007
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Craig S. Ugoretz
    Replies:
    0
    Views:
    412
    Craig S. Ugoretz
    Feb 18, 2004
  2. Ilias Lazaridis
    Replies:
    6
    Views:
    480
    Ilias Lazaridis
    Jan 28, 2006
  3. Kaizen Denki
    Replies:
    0
    Views:
    379
    Kaizen Denki
    Feb 17, 2007
  4. Ilias Lazaridis
    Replies:
    0
    Views:
    122
    Ilias Lazaridis
    Jan 26, 2006
  5. Ilias Lazaridis
    Replies:
    8
    Views:
    155
    Ilias Lazaridis
    Jan 28, 2006
Loading...

Share This Page