简体   繁体   中英

Why java.util is accessible from more than one module : <unnamed>, java.base

I am new to java and working on mutlimodule maven project. I am trying to upgrade project from java 8 to java 11. but when i run 'mvn clean install' i get below error:

[ERROR] Failed to execute goal com.nickwongdev:aspectj-maven-plugin:1.12.6:compile (default) on project module-1: AJC compiler errors:
[ERROR] error at import java.util.Collection;
[ERROR]        ^^^^^^^^

[ERROR] /home/project-name/module-1/apect/classname1.java:22:0::0 The package java.util is accessible from more than one module: <unnamed>, java.base

I am unable to figure out why and where is. i am using sdk version 11.0.16 and apache maven 3.8.6.

It solved. The issue was that I was using 'aspectjrt'(1.9.7) as a transitive dependency of 'aspectj-maven-plugin' and this version of 'aspectjrt' was not compatible with java-11. So I changed it to 1.9.2. And now it's working.

Additionaly I changed there groupId of this plugin to 'org.codehaus.mojo' and used latest version(1.14.0).reference

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM