I am trying to run a java program in linux environment. The program is structured as follows.
src (directory)
-
main (directory)
— test.java
-
common (package)
— a.java
— b.java
Test.java is my main program.
I used the following command to run the program from the src directory level.
javac -cp “../../lib/netcdf.jar:/common/*.java” main/test.java
I am getting errors related to package common not found and all the classes under it are not found.
Can you please help me solve this.
Thanks
I had it compiled and running by using the following command
javac -classpath ‘.:../../lib/*’ main/test.java
Source: http://en.wikipedia.org/wiki/Classpath_%28Java%29