java - How can I compile files when my current working directory is not the default package? -
I have two files in Linux, both in default packages, I am making an example of When I compile the Finder.java file, it returns the error below: I am compiling from a different directory. How do I get to compile both files successfully? To fix your problem, your Java files should be in your classpath so that Java is detected You can manually set the classpath where you will find them: Or I think most people do not face this issue ( Never before!) Because they run AddSingleInstance.java and
Finder.java
AddSingleInstance in
AddSingleInstance A = New AddSingleInstance ();
Finder.java20: Error: can not add symbol AddSingleInstance ai = new AddSingleInstance (); ^
:. $ Path . The easiest way to do this:
cd javadir javac finder.java java finder
javac from their default package (root of their source tree).
Comments
Post a Comment