Author jeff.allen
Recipients jeff.allen
Date 2019-09-28.09:21:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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>(
        at org.python.core.Py.<clinit>(
        at org.python.core.PySystemState.<clinit>(
        at org.python.util.jython.main(
Caused by: java.lang.ClassNotFoundException:
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(
        at java.base/java.lang.ClassLoader.loadClass(
        ... 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 {};
      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 = "1.7".)

PS jython-trunk> ant -D"" 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 {};
       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?
Date User Action Args
2019-09-28 09:21:05jeff.allensetrecipients: + jeff.allen
2019-09-28 09:21:05jeff.allensetmessageid: <>
2019-09-28 09:21:05jeff.allenlinkissue2806 messages
2019-09-28 09:21:05jeff.allencreate