openjdk 13.0.2, 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')

Description

Can someone help?
Compiling Using a Script On The Command Line doesn't seem to work with OpenJDK 13.0.2
I can't create the installer for my jar application. I'm using Izpack 5.1.3 which I downloaded from https://oss.sonatype.org/content/repositories/releases/org/codehaus/izpack/izpack-dist/5.1.3/izpack-dist-5.1.3.jar

Running the script:

"C:\Program Files\IzPack\bin\compile.bat" install.xml -b . setup.jar -k standard
IZPACK_HOME is "C:\Program Files\IzPack\bin\.."

.:: IzPack - Version 5.1.3 ::.

< compiler specifications version: 5.0 >

  • Copyright (c) 2001-2010 Julien Ponge and others. All Rights Reserved.

  • Visit http://izpack.org/ for the latest releases

  • Released under the terms of the Apache Software License version 2.0.

-> Processing : install.xml
-> Output : install.jar
-> Base path : .
-> Kind : standard
-> Compression : default
-> Compr. level: -1
-> IzPack home : C:\Program Files\IzPack\bin\..

Mar 25, 2020 8:46:19 PM com.izforge.izpack.compiler.CompilerConfig <init>
INFO: Logging initialized at level 'INFO'
Mar 25, 2020 8:46:19 PM com.izforge.izpack.compiler.CompilerConfig addInfoStrings
INFO: Pack compression method: default
Mar 25, 2020 8:46:19 PM com.izforge.izpack.compiler.listener.CmdlinePackagerListener packagerMsg
INFO: Setting the installer information
Mar 25, 2020 8:46:19 PM com.izforge.izpack.compiler.CompilerConfig addInfoConditional
INFO: Adding uninstaller
Mar 25, 2020 8:46:19 PM com.izforge.izpack.compiler.listener.CmdlinePackagerListener packagerMsg
INFO: Setting the installer information
Mar 25, 2020 8:46:19 PM com.izforge.izpack.compiler.listener.CmdlinePackagerListener packagerMsg
INFO: Setting the console preferences
-> Fatal error :
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')
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 com.izforge.izpack.merge.resolve.ResolveUtils.getJarUrlForPackage(ResolveUtils.java:172)
at com.izforge.izpack.merge.resolve.PathResolver.getMergeableJarFromPackageName(PathResolver.java:99)
at com.izforge.izpack.compiler.CompilerConfig.addGUIPrefs(CompilerConfig.java:543)
at com.izforge.izpack.compiler.CompilerConfig.executeCompiler(CompilerConfig.java:351)
at com.izforge.izpack.compiler.bootstrap.CompilerLauncher.main(CompilerLauncher.java:55)

Environment

Windows 10

OpenJDK version "13.0.2" 2020-01-14
OpenJDK Runtime Environment (build 13.0.2+8)
OpenJDK 64-Bit Server VM (build 13.0.2+8, mixed mode, sharing)

Activity

Show:
Odysseas Pentakalos
August 3, 2020, 2:32 PM

We had the same issue with JDK 11 and fixed it with the following two small changes.

 

Assignee

Unassigned

Reporter

Karen Gonzalez

Impact

Functional - may break existing environments

Components

Priority

High
Configure