0

I am working on converting my JDK 1.8 project to OPEN JDK -11. As a part of that process there are several places which is uses below tools.jar references. Also I am aware that the tools.jar was depreciated from java 1.9. I need to build my project using OPEN JDK -11 without getting below error. Please support !

Error : Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.11:compile (default) on project commons: Execution default of goal org.codehaus.mojo:aspectj-maven-plugin:1.11:compile failed: Plugin org.codehaus.mojo:aspectj-maven-plugin:1.11 or one of its dependencies could not be resolved: Could not find artifact com.sun:tools:jar:11 at specified path C:\OpenJDK-11/../lib/tools.jar -> [Help 1]

**Maven tags:**  
<profile> <id>default-profile</id> <activation> <activeByDefault>true</activeByDefault> 
            <file> <exists>${java.home}/../lib/tools.jar</exists> </file> </activation> 
            <properties> <toolsjar>${java.home}/../lib/tools.jar</toolsjar> </properties> 
            </profile>

<dependency> <groupId>jdk.tools</groupId> <artifactId>jdk.tools</artifactId> 
            <version>11.0</version> <scope>system</scope> <systemPath>${toolsjar}</systemPath> 
            </dependency> 
  • 1
    The errors is based on the configuration remove the needs to tools jar because it does not exist anymore. also using jdk.tools as a system scope dependency will not work. you have to check why this is needed and remove ti... – khmarbaise Mar 26 '21 at 07:53
  • thank you @khmarbaise for your response. Actually I have no idea about what kind a place in codes which uses this tools.jar file. And I removed above mentioned both maven tags but still getting the same error ! HOW it possible ? – Sahan Sudaraka Mar 26 '21 at 08:02
  • I don't know your code nor your project so I'm not able to help here. – khmarbaise Mar 26 '21 at 08:06
  • My project is a QA automation framework. So there are lists of packages in my project. What kind of places you need to refer my project. I am sure that there is no place which tools.jar file refer in the packages. I think the error exists because of some issues in my pom.xml. Do you need to look into my pom ? – Sahan Sudaraka Mar 26 '21 at 08:18
  • Remove the references from your pom file. Second take a look at the configuration aspectj-maven-plugin. (I would suggest to remove it)... – khmarbaise Mar 26 '21 at 08:25
  • Thank you @khmarbaise I think i lifted for a plus level in the error now. I have tried you solution and now i found where i used tools.jar in my classes. Now the error indicates that there is no imports for - com.sun.tools.javac.code.Symbol in open JDK 11. Could you please let me know is there a alternative way to solve this import which i used in JDK 1.8 ? – Sahan Sudaraka Mar 26 '21 at 08:50

0 Answers0