Error Creating a Maven Project

后端 未结 9 930
遥遥无期
遥遥无期 2021-01-04 11:38

I\'m trying to create a maven project by following this tutorial https://docs.mulesoft.com/mule-user-guide/v/3.7/building-a-mule-application-with-maven-in-studio that time t

相关标签:
9条回答
  • 2021-01-04 12:16

    I think that is problem with your mule studio Java setting. Mule studio by default points JRE not JDK. tools.jar is available under JDK folder. See the below link which tell you how to add JDK to studio then use that to build

    http://www.gamefromscratch.com/post/2011/11/15/Telling-Eclipse-to-use-the-JDK-instead-of-JRE.aspx

    0 讨论(0)
  • 2021-01-04 12:16

    If you are facing with below error from Anypoint studio when building project with Maven.

    [ERROR] [ERROR] Some problems were encountered while processing the POMs:
    [ERROR] Unresolveable build extension: Plugin org.mule.tools.maven:mule-app-maven-plugin:1.2 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_162/../lib/tools.jar @ 
    [ERROR] Unknown packaging: mule @ line 9, column 16
    [WARNING] 'dependencies.dependency.systemPath' for com.sun:tools:jar refers to a non-existing file C:\Program Files\Java\jre1.8.0_162C:\Program Files\Java\jdk1.8.0_162\lib\tools.jar @ line 75, column 21
     @ 
    [ERROR] The build could not read 1 project -> [Help 1]
    [ERROR]   
    [ERROR]   The project com.mycompany:maven-test1:1.0.0-SNAPSHOT (C:\Users\Venkata Phanindra\AnypointStudio\workspace\maven-test1\pom.xml) has 2 errors
    [ERROR]     Unresolveable build extension: Plugin org.mule.tools.maven:mule-app-maven-plugin:1.2 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_162/../lib/tools.jar -> [Help 2]
    [ERROR]     Unknown packaging: mule @ line 9, column 16
    [ERROR] 
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR] 
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    
    [ERROR] [Help 1] 
    http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
    
    [ERROR] [Help 2] 
    http://cwiki.apache.org/confluence/display/MAVEN/PluginManagerException
    

    Please follow the below steps to resolve the issue

    1. From Anypoint studio goto Windows -> Preferences -> Installed JREs.
    2. Here change the JRE (C:\Program Files\Java\jre1.8.0_162) to your JDK (C:\Program Files\Java\jdk1.8.0_162) and select the JDK checkbox and click Finish -> ok -> ok.

    Now try to update the pom.xml file by Right clicking the pom.xml file Mule -> Update project dependencies.

    If still you are facing the issue follow the another step as below:

    1. Goto Windows -> preferences -> Installed JREs -> Execution Environment Here select JavaSE-1.8 and on right window click on the jdk1.8.0_162 [perfect match] and now try to Update project dependencies.

    This will solve the issue.

    0 讨论(0)
  • 2021-01-04 12:24

    I have faced same issue and got resolved by changing the JRE to JDK in preferences and restarted the any point studio. This resolved the issue to me.

    0 讨论(0)
  • 2021-01-04 12:24

    Check whether your MuleStudio.ini contains the configration for the correct path of your JDK:

    -vm
    C:\Path\To\Your\JDK\bin\javaw
    
    0 讨论(0)
  • 2021-01-04 12:25

    I solved the problem, I don't know exactly what has worked but I changed the java version and for every project I execute the following commands:

    mvn clean install
    mvn eclipse:eclipse
    

    and then i refresh my project This can help: http://www.avajava.com/tutorials/lessons/how-do-i-update-my-maven-project-to-work-in-eclipse.html

    0 讨论(0)
  • 2021-01-04 12:31

    I was getting the same error and I solved it by not just adding JDK in the installed JREs but setting Execution environment of JAVASE-1.8 to jdk1.8 and it worked. enter image description here

    0 讨论(0)
提交回复
热议问题