I have this test class
import javax.xml.bind.annotation.XmlElement;
class CompileTest {
void foo( @XmlElement String in ) {
}
}
my java version is
$ java -version
java version "1.6.0_23"
Java(TM) SE Runtime Environment (build 1.6.0_23-b05)
Java HotSpot(TM) Client VM (build 19.0-b09, mixed mode, sharing)
and when I try to compile that class I'm getting
javac CompileTest.java
CompileTest.java:5: annotation type not applicable to this kind of declaration
void foo( @XmlElement String in ) {
^
1 error
and that's valid for Java 6. When I tried to add newer JAXB library to class path, it didn't help. Is there a way to solve this?
javac -cp jaxb-api-2.2.4.jar CompileTest.java