This discussion is archived
8 Replies Latest reply: Mar 11, 2013 5:41 AM by 995862 RSS

How to use a project in another project

995862 Newbie
Currently Being Moderated
I am learning Java, Activiti and Vaadin - all at once. I am so new to Java I am not even sure how to ask this question. I have been searching and trying for the last couple of hours.

I am following a book on Vaadin. They have example code. It needed some classes from example code at their site (http://dev.vaadin.com/svn/doc/book-examples/trunk/). I used Subversive to "download" the project that has all the source code in a project. This is where I am stuck.

I have a project I am using to experiment with. I tried quite a few different things. I suspect that I need the whole project I downloaded to be packaged in some way and then import that into my project.

How do I do what I need to do?
  • 1. Re: How to use a project in another project
    gimbal2 Guru
    Currently Being Moderated
    Basically - stop what you are doing and learn java first. With some effort on your side you may be ready for this kind of stuff in a few weeks.

    But yeah i guess you'll just continue driving yourself mad, running before you can walk. The simplest solution would be to just copy the source into your project. Anything else - see my earlier statement.
  • 2. Re: How to use a project in another project
    995862 Newbie
    Currently Being Moderated
    Good tutorials you recommend? I have been doing one called Java for Total Beginners.
    http://eclipsetutorial.sourceforge.net/totalbeginner.html

    I skip back and forth.
  • 3. Re: How to use a project in another project
    Kayaman Guru
    Currently Being Moderated
    If you need help with the absolute basics, with just Java SE, you could check out the official tutorials: http://docs.oracle.com/javase/tutorial/
  • 4. Re: How to use a project in another project
    rp0428 Guru
    Currently Being Moderated
    >
    I suspect that I need the whole project I downloaded to be packaged in some way and then import that into my project.
    >
    In order of recommended preference

    1. Do NOT try to learn three interdependent technologies like that at the same time. Sample code for one project may use advanced features of one of the other projects. Learn the basics of each technology one at a time before you start combining them.

    2. Download the pre-built jar files and then add them to your classpath. That site has a release folder where you can find the jar files
    http://dev.vaadin.com/svn/releases/

    3. Download the source files (you say you did) and build THEIR project manually then use those jar files in your project. For someone new to Java that would NOT be recommended. You may not have the tools needed to do the build properly and you will spend more time trying to get the build working when you would be better off using the time to learn Java. They may use Eclipse while you may be using NetBeans. Their pre-packaged build scripts may not work at all with NetBeans.

    4. Add their source files to your project. The kicker here is that they may be using other third-part jar files and you will need to find and download the correct versions of those. See item #2 above.
  • 5. Re: How to use a project in another project
    995862 Newbie
    Currently Being Moderated
    Thanks to both of you. I am learning the basics of Java now, then I will move on.
    rp0428 I do appreciate your answer. That makes things clearer. It helps my understanding of Java.

    I'll keep working on Java.
  • 6. Re: How to use a project in another project
    MackSix Newbie
    Currently Being Moderated
    In NetBeans you can just setup projects as a NetBeans project, compile them then add them to another project in the Project Properties>>Libraries>>Add Project button. Just navigate to the project directory and add it and the Jar is added.
  • 7. Re: How to use a project in another project
    995862 Newbie
    Currently Being Moderated
    Just as a general statement...

    I have finished the Java for Total Beginners tutorial. Excellent, even if you have previous programming knowledge.
    http://eclipsetutorial.sourceforge.net/totalbeginner.html

    As I look for tutorials I can't seem to find any...just kidding!!! There are tons of really good tutorials on java out there. I'm willing to bet that a lot of questions could be answered that are on these forums if people would just work some of the tutorials.

    I started programming in 1974 with very simplistic basic. I have experience in Visual Basic and PHP. I can already tell you that there is a huge gap between PHP and Java. Visual Basic, less so but it is clear that Java is benefiting from what I call the "Open Source revolution". To look at how things have changed today with a language like Java...wow. Eclipse makes it so much easier with all kinds of features including these wizards that create all kinds of declarations and routines for you.

    All this to say...thanks for encouraging me to learn the basics. On the surface these languages may seem a bit similar. It is clear that Java is a much deeper language with far different methodology (like using Junit).


    My final word...if you are new to Java, use the tutorials!
  • 8. Re: How to use a project in another project
    gimbal2 Guru
    Currently Being Moderated
    992859 wrote:
    All this to say...thanks for encouraging me to learn the basics. On the surface these languages may seem a bit similar. It is clear that Java is a much deeper language with far different methodology (like using Junit).
    Unit testing or test driven development is the methodology, JUnit is just a tool to get it started. You could also use TestNG. You can also completely skip it. You can also do it in any other language/platform you want. It has nothing to do with Java specifically.
    My final word...if you are new to Java, use the tutorials!
    We've been crying it for as long as this forum exists, but thanks for adding your voice too. Although I would suggest a good book first. So undervalued nowadays and still the best learning tool around, besides experimentation. The internet is great but it is also filled to the brim with misinformation, you need a solid base first to be able to split the truth from the nonsense. The same can be said for the usage of an IDE; they're great but if you don't know your way around the JDK first, things go wrong.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points