import ...
public class TriggerJob {
String jobStatus = \"\";
SchedulerMetaData metaData = null;
public void rightNow(HashMap ParamMap){
AnotherProj
You can do it in 2 ways.
Export the other project to jar
and import the jar in your project.
OR
In the dependency you can add the other projects to your project. Right click on project --> properties --> java build path --> projects
. Add your project here
This works fine as long as you have imported the project containing the classes.
Assuming your using Eclipse the following steps will work:
You can do either this way:
In the dependency you can add the other projects to your project. Right click on project -> properties -> java build path -> projects. Add your project here.
OR
Make the classes of project into jar and add it to other project
Dependencies should be added in classpath
In run time, make sure the JAR files of the referenced projects is added in class path on both the cases.
Make the classes of the project A into jar
and add it to the class path of the other project B
Yes. In the Project Explorer right click on it and select Properties, there go to Java Build Path and select Projects tab. Add your other project here, now you're able to use the classes from it in your current project. But note BOTH have to be open when you run them or debug in eclipse (otherwise you will see red lines telling you a class was not found).
I had a similar problem and finally I realized that the problem was that the class in the calling project was not under src
folder, but inside another inner package. When I removed that folder and moved the file to the src
folder, everything worked.