tags:

views:

37

answers:

2

Hello I am new to Eclipse (and I am a novice in Java): I am creating a project which should make use of some classes from another project. Do I have to export necessarily this last project as JAR file and add in my project? Are there other alternatives?

A: 
  1. If you have the source of those class files you can just link that source
  2. Or add the other project as a dependent project.
  3. Or create a jar of those classes and add that in lib.
nobody
+1  A: 

There are several alternatives:

  • If project A depends on project B, and both projects are in the same Eclipse workspace, you can just project B to project A's build path (project properties / build path / project). This has the nice advantage that it will (optionally) automatically pull in project B's JARs, plus updates to B will be used automatically by A, and you can debug into B's code (even using hot code replace).
  • If A and B are fairly separate, just make B into a JAR (or several ones), then add these to A's build path.
sleske