V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
chillwind
V2EX  ›  Java

碰到个非常奇怪的问题, mvn 启动不了了

  •  
  •   chillwind · 2023-11-05 19:26:36 +08:00 · 1069 次点击
    这是一个创建于 385 天前的主题,其中的信息可能已经有所发展或是发生改变。

    执行了 yum groupinstall "Development tools"这个命令后,发现 mvn 启动不了了,换个好几个版本的 maven 都不行 不同版本的报错还不一样,但总的看都是类加载的问题,有没有人遇到过这个问题

    Exception in thread "main" java.lang.ClassFormatError: UnknMavenExecutionRequest at java.base/java.lang.ClassLoader.defineClass1(Native Method) at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1009) at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174) at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:545) at java.base/java.net.URLClassLoader.access$100(URLClassLoader.java:83) at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:453) at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:447) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:446) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(ClassRealm.java:401) at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:42) at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239) at org.apache.maven.cli.MavenCli.main(MavenCli.java:199) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)

    Exception in thread "main" java.lang.NoClassDefFoundError: sferListener at java.base/java.lang.Class.getDeclaredMethods0(Native Method) at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3119) at java.base/java.lang.Class.getMethodsRecursive(Class.java:3260) at java.base/java.lang.Class.getMethod0(Class.java:3246) at java.base/java.lang.Class.getMethod(Class.java:2065) at org.codehaus.plexus.classworlds.launcher.Launcher.getEnhancedMainMethod(Launcher.java:172) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:268) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) Caused by: java.lang.ClassNotFoundException: org.eclipse.aether.transfer.TransferListener at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50) at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239) ... 10 more

    Exception in thread "main" java.lang.Error: java.net.URISyntaxException: Ille-m.jar at java.base/java.io.File.toURI(File.java:738) at org.codehaus.plexus.classworlds.launcher.Configurator.addLoadFile(Configurator.java:194) at org.codehaus.plexus.classworlds.launcher.ConfigurationParser.loadGlob(ConfigurationParser.java:370) at org.codehaus.plexus.classworlds.launcher.ConfigurationParser.parse(ConfigurationParser.java:253) at org.codehaus.plexus.classworlds.launcher.Configurator.configure(Configurator.java:131) at org.codehaus.plexus.classworlds.launcher.Launcher.configure(Launcher.java:128) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:401) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:348) Caused by: java.net.URISyntaxException: Illegal character in path at index 32: file:/root/software/apache-maven.jar at java.base/java.net.URI$Parser.fail(URI.java:2915) at java.base/java.net.URI$Parser.checkChars(URI.java:3086) at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3168) at java.base/java.net.URI$Parser.parse(URI.java:3116) at java.base/java.net.URI.<init>(URI.java:685) at java.base/java.net.URI.<init>(URI.java:786) at java.base/java.io.File.toURI(File.java:736) ... 7 more

    3 条回复    2023-11-05 21:29:36 +08:00
    julyclyde
        1
    julyclyde  
       2023-11-05 20:48:27 +08:00
    which java
    zjp
        2
    zjp  
       2023-11-05 21:05:33 +08:00
    看起来是和 Java 版本不匹配,mvn -X 运行看下
    szq8014
        3
    szq8014  
       2023-11-05 21:29:36 +08:00
    file:/root/software/apache-maven.jar 是你自己填的吗?似乎报错是说这个不是一个标准的 URI ,不行你改成 file:///root/software/apache-maven.jar
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5761 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 06:37 · PVG 14:37 · LAX 22:37 · JFK 01:37
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.