E.g: I got a Java class with the main function implemented like this:
public class Job{
public static void main(String[] args) throws Exception{
Job jobA = new Job();
String jobName = System.getProperty("JobName");
job.DoJobA("jobName");
}
public void DoJobA(String jobName){
String configPath = System.getProperty("ConFig");
File file = new File(configPath+ "/" + jobName);
DoJobB(file);
}
}
And I another class and want to call the main function of class Job but couldn’t find a way to do that!
Is there any advise for me?
You should be able to call it like you call any other static method
Job.main(yourArgs);