Is it possible to replace the version of the JAXB implementation in Java JRE 1.6 SE? -
i have 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 try compile class i'm getting
javac compiletest.java compiletest.java:5: annotation type not applicable kind of declaration void foo( @xmlelement string in ) { ^ 1 error
and that's valid java 6. when tried add newer jaxb library class path, didn't help. there way solve this?
javac -cp jaxb-api-2.2.4.jar compiletest.java
use java endorsed standards override mechanism
put jaxb-api-2.2.4.jar
inside <java-home>\lib\endorsed
directory.
or, use -d java.endorsed.dirs option
javac -djava.endorsed.dirs=/your/path/to/jaxb-directory compiletest.java
references:
http://docs.oracle.com/javase/6/docs/technotes/guides/standards/