0

I am trying to use a jar file to execute a gui interface. I am kicking off the main method from a class that is outside the jar, but inside the jar is a method that references back to the class that kicked off the program.

Class outside the jar:

public class Player {
    public static int turn(int x, int y){
        return 3;
    }

    public static void main(String[] args){
        GameGui.main(args); //Class inside JAR
    }
}

Method inside the jar:

public void turn(){

 int move = Player.turn(3,4);
}
  • Not sure what your question is. – David Ehrmann Oct 07 '18 at 00:21
  • When I run the code above, the turn() method can't find the Player class. I would like to be able to reference the Player class (which is not in the Jar file) from a method that is inside the Jar file. – David Burnham Oct 07 '18 at 00:24
  • Add it to the class path? https://stackoverflow.com/questions/18413014/run-a-jar-file-from-the-command-line-and-specify-classpath – Charles Oct 07 '18 at 00:25

0 Answers0