|
Include java classes from another JDeveloper project |
|
Facts -
Java
|
|
Wednesday, 21 April 2010 19:35 |
|
This page is for Oracle JDeveloper 11.1.1.2.0.
There are several ways to include java classes from an existing JDeveloper project into a new JDeveloper project:
- Include the directory containing the source files into the new project
- Include the directory containing the compiled java classes into the classpath of the new project.
- Merge the sources of the two projects into one project.
For the first option do the following:
- Right click on the project and choose Project Properties from the context menu.
- In the properties window Choose Project Source Path and add references to the source files you want to include. You can finetune directories with the tabs include and exclude.
For the second option do the following:
- Right click on the project and choose Project Properties from the context menu.
- In the properties window Choose Libraries and Classpath and add references to the compiled files you want to include using the button Add JAR/Directory.
Note that when adding java classes to the classpath you can not include/exclude specific classes from added directories/jar files as is possible when adding source files.
The advantage of the third method is that it is not necessary to use such adhoc modifications to the JDeveloper project: it will make the project easier to build for others. Of course the third method is not always possible, one of the projects might be needed by many other java projects and we don't want to end up with a gigantic single java project.
|