简体   繁体   中英

Maven project runs in command line but not in Eclipse

Problem:

In short, I can run my uber jar (generated by the maven shade plugin) OUTSIDE of eclipse, by using java -jar myJar.jar (the main class is specified in the maven jar plugin), BUT I can't run the Main class inside the eclipse.

when running in eclipse, it runs from the target\\classes folder, and I check all the dependencies are correctly listed in the classpath.

I also checked java -version, both eclipse and cmd got the same version

I wander what difference would it be?

add -vm C:program\\javaxxxx\\jre\\bin\\javaw.exe fix this

not java version for me has to be 1.7+

the eclipse.ini

its mainly because java.home is used in one of the pom. eclipse failed to pass the java home then such pom fails to pass the transitive dependencies therefore libraries will go missing

Take look of this.

Maven not picking JAVA_HOME correctly

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