Please somebody explain to me on classpath on following:
1)I have following files;
i)C:\folder1\com\Class1.java
ii)C:\folder2\com\Class2.java
(Class2 extends from Class1)
iii)C:\folder3\org\Class3.java
2)Class3 file contains following lines;
package org;
import com.Class2;
class Class3{
public static void main(
String args]{
}}
When I am compiling from C:\folder3\org>:
----------------------------------------
javac -classpath %path;C:\folder2 Class3.java,it
compiles fine.
a)when I am running from same directory
java Class3
it produces an error:NoClassDefintionFound
but when I comment out package line it works
fine.How?
b)javac -classpath %path;C:\folder1;C:\folder2;
C:\folder3 Class2.java produces an error,can't
read Class2.java.Why it happens while
import com.Class2; statement of Class3 in the same directory compiles without a problem?
In all, what modifications I have to make to compile and run in same directory.It now appears
to me like a ghost story