I have a project that I have compiled to a jar with Maven which I named H.jar. The maven command I use is (in eclipse):
maven install
The jar file has a class called Person in it. I have added the jar file to the classpath on a Windows machine.
echo %classpath%
Results -> C:\location_to_jar\H.jar
But when I try to compile the program I get error:
error. Cannot find symbol.
I am running the command:
javac Main.java
The class looks like this:
public class Main { public static void main(String[] args) { Person p = new Person("John", "Doe"); p.toString(); } }
Should the program not just find the class if I have added it to the classpath?