Relates :
|
|
Relates :
|
|
Relates :
|
I have following directory structure: . ./Main.java ./sahoo/Sless.class ./sahoo/Sless.java ./sahoo/SlessBean.class ./sahoo/SlessBean.java ./lib/javax/ejb/Local.class ./lib/javax/ejb/Local.java ./Main.java ----------- class Main{ public static void main(String... args){ sahoo.SlessBean sless; } } ./sahoo/SlessBean.java ---------------------- package sahoo; @javax.ejb.Local(sahoo.Sless.class) public class SlessBean implements Sless { public void bar() {} } ./sahoo/Sless.java ------------------ package sahoo; public interface Sless { void bar(); } When I try compiling: javac Main.java I get the following error: Main.java:3: cannot find symbol symbol : class SlessBean location: package sahoo sahoo.SlessBean sless; ^ 1 error But when I compile with lib in classpath, i.e. javac -classpath .:lib Main.java it compiles fine. So I don't understand why I need javax.ejb.Local to be in my compilation class path. More over, even if I needed that class, I would expect a better error message from compiler. javax.ejb.Local.class is defined as follows: lib/javax/ejb/Local.java ------------------------ package javax.ejb; public @interface Local{ Class[] value() default {}; }
|