Using folder: /home/bira/Javanew CLASSPATH= . (using ubuntu linux)
created under /home/bira/Javanew package base;
public class Base
{
public void show()
{
System.out.println("Base function's show");
}
}
Comiled the above using : javac -d . Base.java
below created under /home/bira/Javanew
import base.*;
class Derived { public static void main(String args[]) { Base b = new Base(); b.show(); } }
getting following error:
javac Derived.java Derived.java:8: error: cannot access Base Base b = new Base(); ^ bad source file: ./Base.java file does not contain class Base Please remove or make sure it appears in the correct subdirectory of the sourcepath. 1 error
I know that i have messed up the classpath into something. Please help me..stucked with it for while.
Ads