Community
Participate
Working Groups
In Java 9 the format of "java.version" has changed in JEP223 (http://openjdk.java.net/jeps/223) to no longer use the 1.x.* format, but instead use "9*" format. With Java 9 early access (9-ea) release, expression with "@annotation" throws the following exception: java.lang.IllegalArgumentException: error the @annotation pointcut expression is only supported at Java 5 compliance level or above at org.aspectj.weaver.tools.PointcutParser.parsePointcutExpression(PointcutParser.java:301) On first sight the problem is that in: "util/src/org/aspectj/util/LangUtil.java" java.version string is parsed as: try { String versionString = vm.substring(0, 3); Double temp = new Double(Double.parseDouble(versionString)); vmVersion = temp.doubleValue(); } catch (Exception e) { vmVersion = 1.4; } vm is the "java.version" system variable, that no longer follows the 1.x format (in early release case it is 9-ea, on the stable release it will be simply "9", and with later minor/major releases 9.x.y). 9-e will not be parsed to Double and will throw an exception, so vmVersion is set to 1.4.
If you want to use a 1.9 JVM, you should use AspectJ for Java9 and not AspectJ 1.8. AspectJ 1.9.0 is currently on beta5. http://www.eclipse.org/downloads/download.php?file=/tools/aspectj/aspectj-1.9.0.BETA-5.jar maven: <repository> <id>repo.spring.io</id> <name>SpringSource milestones</name> <url>http://repo.spring.io/milestone</url> </repository> version: 1.9.0.BETA-5
Thank you Andrew, I'm closing this ticket now. I have only checked the latest version in central repository and the code in master.