简体   繁体   English

异常 class jdk.internal.loader.ClassLoaders$AppClassLoader 无法转换为 class java.net.URLClassLoader

[英]Exception class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader

I don't understand how to fix it, first time i see mistake like this.我不明白如何解决它,我第一次看到这样的错误。 i downland this from github https://github.com/nikishubin/Notebook but its does not work我从 github https://github.com/nikishubin/Notebook下载了这个,但它不起作用

OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.
    Exception in thread "main" java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader 'bootstrap')
        at org.springframework.boot.devtools.restart.DefaultRestartInitializer.getUrls(DefaultRestartInitializer.java:93)
        at org.springframework.boot.devtools.restart.DefaultRestartInitializer.getInitialUrls(DefaultRestartInitializer.java:56)
        at org.springframework.boot.devtools.restart.Restarter.<init>(Restarter.java:140)
        at org.springframework.boot.devtools.restart.Restarter.initialize(Restarter.java:546)
        at org.springframework.boot.devtools.restart.RestartApplicationListener.onApplicationStartingEvent(RestartApplicationListener.java:67)
        at org.springframework.boot.devtools.restart.RestartApplicationListener.onApplicationEvent(RestartApplicationListener.java:45)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:122)
        at org.springframework.boot.context.event.EventPublishingRunListener.starting(EventPublishingRunListener.java:69)
        at org.springframework.boot.SpringApplicationRunListeners.starting(SpringApplicationRunListeners.java:48)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:292)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)
        at org.surplus.radolf.Notebook.NotebookApplication.main(NotebookApplication.java:10)
    
    Process finished with exit code 1

my main class我的主class

package org.surplus.radolf.Notebook;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;


@SpringBootApplication
public class NotebookApplication  {
    public static void main(String[] args) {
        SpringApplication.run(NotebookApplication.class, args);
    }
}

From the pom file its noted that java 1.8 is refered can you can you please check java 1.8 is in your system path varibale or later version.从 pom 文件中注意到 java 1.8 被引用,您能否请检查 java 1.8 是否在您的系统路径变量或更高版本中。 if later please use 1.8 and try to run the program.如果以后请使用 1.8 并尝试运行该程序。

If Java is 1.8, then check parent should match the release of the STS tools you ar using (ie) Groupid and artifact and version如果 Java 为 1.8,则检查父级应与您正在使用的 STS 工具的版本相匹配(即 Groupid 和工件和版本)

An alternative to installing Java 8 is to use your IDE's built in JDK.安装 Java 8 的替代方法是使用 IDE 的内置 JDK。

In InteliJ, you can go to Tools tab:在 InteliJ 中,您可以 go 到工具选项卡:

Click on 'Edit Configurations'点击“编辑配置”

And select java 8和 select java 8

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 HIVE:异常:class jdk.internal.loader.ClassLoaders$AppClassLoader 无法在 Mac 上使用 JDK8 转换为 class java.net.URLClassLoader - HIVE: Exception: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader using JDK8 on Mac 基于 Java 的 Azure 函数 - 异常:ClassCastException:无法转换 class jdk.internal.loader.ClassLoaders$AppClassLoader - Java based Azure Function - Exception: ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast Ubuntu Minecraft 服务器 java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader - Ubuntu Minecraft Server java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader dalvik.system.PathClassLoader 不能转换为 java.net.URLClassLoader - dalvik.system.PathClassLoader cannot be cast to java.net.URLClassLoader java.lang.reflect.inaccessibleobjectexception 无法使 jdk.internal.loader.classloaders - java.lang.reflect.inaccessibleobjectexception unable to make jdk.internal.loader.classloaders java.net.URLClassLoader不添加类注释 - java.net.URLClassLoader doesn't add class annotations Hive:虽然使用 JDK8,但无法将 AppClassLoader 强制转换为 URLClassLoader - Hive: AppClassLoader cannot be cast to URLClassLoader although using JDK8 Java ClassLoaders - 将 class 转换为接口 - Java ClassLoaders - Cast class to an interface 例外 - class [B 不能转换为 class [C([B 和 [C 在模块 java.base 的加载程序“引导程序”中) - Exception - class [B cannot be cast to class [C ([B and [C are in module java.base of loader 'bootstrap') Java中的类强制转换异常:无法强制转换 - Class Cast Exception in Java: cannot be cast
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM