I have a java project that has 10 .java files. A1.java, A2.java......A9.java and Main.java. I have to built and run that project in UNIX environment. All the 10 .java files reside inside grand.big.medium.small package. To compile the java file I go inside the grand/big/medium/small folder and type the command:
javac *.java
All the files gets compiled and all the .class files gets created in the current folder, also, I get the following message:
Note: A4.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: A4.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Now I run the Main.class be typing:
java -classpath . Main
and I get the error message:
Error: Could not find or load main class Main
I am new to Unix and do not know much about this, Could anyone tell what is that I am doing wrong. Just to add, I have 3 java version installed
Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-8-oracle/jre/bin/java 1072 auto mode
1 /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java 1061 manual mode
2 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1071 manual mode
* 3 /usr/lib/jvm/java-8-oracle/jre/bin/java 1072 manual mode
Press enter to keep the current choice[*], or type selection number:
and I am using Java 8.