ns9999
Smart
2018-12-18 14:04

maven打包的springboot项目运行出错

5
  • spring
  • maven
  • intellij-idea

mvn package无错误

java -jar target/eureka-server.jar

Exception in thread "main" java.lang.IllegalAccessException: Class org.springframework.boot.loader.MainMethodRunner can not access a member of class cn.com.smartning.cloudproject.eurekaserver.EurekaServerApplication with modifiers "public static"
    at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:102)
    at java.lang.reflect.AccessibleObject.slowCheckMemberAccess(AccessibleObject.java:296)
    at java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:288)
    at java.lang.reflect.Method.invoke(Method.java:491)
    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
    at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

2条回答

为你推荐