Maven 3 Artifact problem

后端 未结 9 1458
旧巷少年郎
旧巷少年郎 2020-12-06 04:14

I made a new struts project in eclipse using the struts2-archtype-starter.

A few errors where in my project already before doing anything. Solved most of them but th

9条回答
  •  佛祖请我去吃肉
    2020-12-06 04:37

    The error you are seeing is probably because you dont have your JAVA_HOME path set up correctly. Are you seeing something like C:\{directories to jre}\..\lib\tools.jar?

    You can have eclipse start up using your built in JDK by altering the eclipse.ini and adding something like

    -vm
    C:\{directories to JDK}\bin\javaw.exe
    

    What I have learned is that eclipse by default will use your system jre to start eclipse. You probably have seen a message when starting eclipse similar to "Eclipse is running under a JRE and m2eclipse requires a JDK some plugins will not work"

    If you go to (in eclipse) Help -> Installation Details and look for a -vm you will probably see it pointing to somewhere that does not have the path structure that it is expecting.

    Note: For whatever reason when I encountered this issue java.home in maven was evaluated from where eclipse was launched from. So when it tries to pull the tools.jar from what it sees as java.home it may not be what you actually set as JAVA_HOME as an env/system variable.

提交回复
热议问题