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:
- If you have the source of those class files you can just link that source
- Or add the other project as a dependent project.
- Or create a jar of those classes and add that in lib.
nobody
2010-06-14 10:22:08
+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
2010-06-14 10:23:15