class not found

I created an interface ABC with some functions and then created a jar file of it.

Next i created a class DEF implementing ABC providing the jar file in the classpath:

c:\folder>javac -cp abcjar.jar DEF.java it compiles fine.

but when i give the DEF class a package 'pack' and compile:

c:\folder>javac -cp abcjar.jar pack\DEF.jar it says:

error: cannot find symbol class ABC

can anyone help

[440 byte] By [bhupendra.aolea] at [2007-10-2 9:05:58]
# 1

> I created an interface ABC with some functions and

> then created a jar file of it.

> Next i created a class DEF implementing ABC providing

> the jar file in the classpath:

> c:\folder>javac -cp abcjar.jar DEF.java it compiles

> fine.

>

> but when i give the DEF class a package 'pack' and

> compile:

> c:\folder>javac -cp abcjar.jar pack\DEF.jar it says:

> error: cannot find symbol class ABC

>

> can anyone help

After you added the package statement to DEF, it is under a different package from ABC. You now need to explicitly write an import statement to use ABC.

As a suggestion, do not use default packages and have a package for each class.

aniseeda at 2007-7-16 23:12:59 > top of Java-index,Developer Tools,Java Compiler...
# 2
Thanxjust by giving every1 a package every1 happy.
bhupendra.aolea at 2007-7-16 23:12:59 > top of Java-index,Developer Tools,Java Compiler...