From: Jeff A. <re...@bu...> - 2019-09-28 09:21:21
|
New submission from Jeff Allen <ja...@fa...>: When built with Java 8, although the developer build checks out ok, the installed version of Jython (in fact, the installation itself) fails with the message: PS 272a-trial> java -jar kit\jython-installer.jar Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/collect/MapMaker at org.python.core.ThreadStateMapping.<clinit>(ThreadStateMapping.java:31) at org.python.core.Py.<clinit>(Py.java:1734) at org.python.core.PySystemState.<clinit>(PySystemState.java:72) at org.python.util.jython.main(jython.java:531) Caused by: java.lang.ClassNotFoundException: com.google.common.collect.MapMaker at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ... 4 more Investigation shows that the call is there are described: PS jython-trunk> javap -c -cp dist/jython.jar org.python.core.ThreadStateMapping ... static {}; Code: 0: new #40 // class com/google/common/collect/MapMaker The cause is in the jarjar task in our Ant build that is responsible for renaming dependencies we bundle in the JAR. When the target JVM is 1.7, the all is well. (I'm still actually building with Oracle Java version 1.8.0_211, but jython.java.version = "1.7".) PS jython-trunk> ant -D"jython.java.version=1.7" clean installer (A clean is needed to force recompilation.) In this case, the same investigation shows the call has been renamed correctly: PS 272a-trial> javap -c -cp inst/jython.jar org.python.core.ThreadStateMapping ... static {}; Code: 0: new #179 // class org/python/google/common/collect/MapMaker Actually, it is only necessary to build the jython.jar (jar-complete target) to see the effect in dist/jython.jar. I wonder if this is simply a consequence of jarjar 1.4 using an old version of ASM. However, it is not completely obvious where to get the legitimate successor version of jarjar. Maybe we compile with 8 for this release but target 7 in the generated code? ---------- components: Installer messages: 12662 milestone: Jython 2.7.2 nosy: jeff.allen priority: high severity: major status: open title: Installer contains dependencies unshaded (Java 8) type: crash versions: Jython 2.7 _______________________________________ Jython tracker <re...@bu...> <https://bugs.jython.org/issue2806> _______________________________________ |