Reputation: 117
I saw some other similar posts, but they didn't seem to answer my question.
I have a package of java files, and the java functions inside one file call java functions from a different file. Right now I am limited to run my program from the parent directory of gitlet as shown in the screenshot. Is there a way to run my java program from any arbitrary directory?
P.S. I am hoping to get a solution that can be done just inside terminal.
Upvotes: 2
Views: 53
Reputation: 32517
From anywhere
java -cp path/to/my/compiled/classes/directory1 fully.qualified.name.of.BootstrapClass
Upvotes: 4
Reputation: 83527
Is there a way to run my java program from any arbitrary directory?
Yes, you can add the base directory that contains the compiled .class
files to the CLASSPATH
environment variable.
Upvotes: 2