Details
-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
None
-
5.0u1
-
generic
-
generic
Description
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 {};
}
.
./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 {};
}
Attachments
Issue Links
- relates to
-
JDK-6322301 unknown annotations are not ignored in Class.getAnnotations
- Closed
-
JDK-6214965 crash: java.lang.AssertionError at com.sun.tools.javac.jvm.ClassReader$AnnotationDeproxy.findAccessM
- Closed
-
JDK-6365854 javac crashes when compiling against an annotated class
- Closed