Can we call another project java class from our project in eclipse

前端 未结 9 1592
心在旅途
心在旅途 2020-11-30 07:40
import ...

public class TriggerJob {

    String jobStatus = \"\";
    SchedulerMetaData metaData = null;

    public void rightNow(HashMap ParamMap){ 

AnotherProj         


        
9条回答
  •  囚心锁ツ
    2020-11-30 07:59

    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.

提交回复
热议问题