I'm using some JSR166 classes with Java 1.6, some of which are under java.util.concurrent
. I am on OSX, though I expect this to ultimately run on Linux.
If I set this environment variable I can run my project:
export MAVEN_OPTS=-Xbootclasspath/p:/Users/me/.m2/repository/org/codehaus/jsr166-mirror/jsr166/1.7.0/jsr166-1.7.0.jar
I tried following the instructions here and putting the setting in my pom.xml
:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<version>3.0</version>
<compilerArguments>
<verbose/>
<bootclasspath>/Users/me/.m2/repository/org/codehaus/jsr166-mirror/jsr166/1.7.0/jsr166-1.7.0.jar</bootclasspath>
</compilerArguments>
</configuration>
</plugin>
Unfortunately this gave an error about not being able to find java.lang
. If I add a reference to classes.jar
(apparently OSX's version of rt.jar
) in the bootclasspath
I can fix that error, but that just puts me back where I started:
java.lang.SecurityException: Prohibited package name: java.util.concurrent
How should I set up maven to use this argument correctly?
Shouldn't you use extdir for this, instead of bootclasspath?
From http://maven.apache.org/plugins/maven-compiler-plugin/examples/pass-compiler-arguments.html