简体   繁体   中英

Anypoint Studio Maven looking in wrong java directory for tools.jar

I installed the latest version of Anypoint Studio (based on Eclipse) and created a new maven enabled project. I got the following error as maven tried to resolve all of it's dependencies:

[ERROR] Unresolveable build extension: Plugin org.mule.tools.maven:mule-app-maven-plugin:1.1 or one of its dependencies could not be resolved: Could not find artifact com.sun:tools:jar:1.5.0 at specified path C:\Program Files\Java\jre1.8.0_65/../lib/tools.jar -> [Help 2]

I have JDK 1.8 installed on the system, and have my PATH and JAVA_HOME environmental variables set.

Why is it looking in the incorrect location for the library?

It turned out that by default Anypoint Studio was pointing to the JRE rather than the JDK. This lead to it not being able to locate tools.jar .

First thing I did was I added the JDK by searching for it in the Java directory. Open Window -> Preferences -> Java -> Installed JREs, Click search, then navigate to your JDK. Once the JDK is added to the list, select it as the default run-time:

Go to your project properties -> Java Build PAth -> Libraries. Remove the current JRE system library and click Add Library, search for your JDK under the list of installed JDKs.

在此处输入图片说明

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