Java 9, compatability issue with ClassLoader.getSystemClassLoader

后端 未结 8 1291
面向向阳花
面向向阳花 2020-11-29 09:19

The following code adds jar file to the build path, it works fine with Java 8. However, it throws exception with Java 9, the exception is related to the cast to URLClassLoad

8条回答
  •  自闭症患者
    2020-11-29 10:01

    i found this, and worked for me.

    String pathSeparator = Syste .getProperty("path.separator"); String[] classPathEntries = System.getProperty("java.class.path") .split(pathSeparator);

    from the web site https://blog.codefx.org/java/java-11-migration-guide/#Casting-To-URL-Class-Loader

提交回复
热议问题