How to get access to javax.annotation.Resource at run time in Java 9
问题 I have a test: public class ResourceTest { @Test public void test() throws ClassNotFoundException { Class.forName("javax.annotation.Resource"); } } It tries to access javax.annotation.Resource . In java 8 it worked, but in java 9 (I'm using Oracle JDK 9) it fails with ClassNotFoundException . As explained here Spring: @Resource injection stopped working under JDK9 , javax.annotation.Resource from the JDK is not available by default in Java 9. I'm trying to get access to it using module