mvnassembly: java.lang.ClassFormatError: Unknown constant tag 98 in class file Loader

1,655 views
Skip to first unread message

Rakhitha Karunarathne

unread,
Sep 5, 2017, 6:45:15 AM9/5/17
to robocode-developers
Hi All,

I posted this once but I cant find it in the groups so I'll post one more time.

I am trying to build robocode using build instruction given in here. But I keep getting following error.

I have tried with JDK 1.6.0 as well as JDK 1.6.45. Could not find much info about this error on the web other than class files might be corrupted. Which is unlikely as I got all files from robocode jit repository.

Has anyone got this error? Any idea on how to resolve this? Or Am I doing something wrong?

Following is the stacktrace I get in console.

Best Regards!
/Rakhitha

D:\robocode-1.9.2.6>java -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)

D:\robocode-1.9.2.6>mvnassembly
Exception in thread "main" java.lang.ClassFormatError: Unknown constant tag 98 in class file Loader
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: Loader.  Program will exit.
Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/classworlds/Launcher
Caused by: java.lang.ClassNotFoundException: org.codehaus.classworlds.Launcher
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: org.codehaus.classworlds.Launcher.  Program will exit.


Julian Kent

unread,
Sep 5, 2017, 4:44:54 PM9/5/17
to robocode-...@googlegroups.com
Hi

I believe this is due to building on an old version of the JVM, which doesn't understand newer .jars which get downloaded by Maven.

Note that building on a new version of the JVM still targets the old version, you don't need to build on an old version to do so.

Hope this helps
Julian

--

---
You received this message because you are subscribed to the Google Groups "robocode-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robocode-developers+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Flemming Larsen

unread,
Sep 6, 2017, 1:34:26 PM9/6/17
to robocode-developers
Hi Rakhitha,

Julian is right. Robocode is built for Java 6. But you can use a newer version, e.g. JDK 8, to build robocode with Maven. :-)

Best regards,
- Flemming


Den tirsdag den 5. september 2017 kl. 22.44.54 UTC+2 skrev Julian Kent:
Hi

I believe this is due to building on an old version of the JVM, which doesn't understand newer .jars which get downloaded by Maven.

Note that building on a new version of the JVM still targets the old version, you don't need to build on an old version to do so.

Hope this helps
Julian

Rakhitha Karunarathne

unread,
Sep 7, 2017, 3:17:01 AM9/7/17
to robocode-...@googlegroups.com
Hi,

Thanks for the Info.

I am still getting following error with JDK 1.8.

Whats interesting is that the same erorr show up if I just run MVN command. Which made me think problem is with MVN itself.

Do I need to use a different version of maven or something?

Best Regards!
/Rakhitha

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.ClassFormatError: Unknown constant tag 98 in class file Loader
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:495)
Error: Could not find or load main class org.codehaus.classworlds.Launcher

--

---
You received this message because you are subscribed to the Google Groups "robocode-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robocode-developers+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
--------------------------------------------
Rakhitha .M. Karunarathne
http://RaKasUniverse.info

Rakhitha Karunarathne

unread,
Sep 7, 2017, 4:34:52 AM9/7/17
to robocode-...@googlegroups.com
Hi Again,

Sorry about repeated mails.

I was able to narrow down the error to following line in LoadTools.cmd

java -cp "%~dp0\loader" Loader http://robocode.sourceforge.net/tools/libs/ "%~dp0\lib/" ant.jar ant-contrib-0.6.jar ant-launcher.jar jacobe.jar junit.jar classworlds-1.1.jar maven-2.2.1-uber.jar

Any ideas?

Best Regards
/Rakhitha



To unsubscribe from this group and stop receiving emails from it, send an email to robocode-developers+unsubscribe...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
--
--------------------------------------------
Rakhitha .M. Karunarathne
http://RaKasUniverse.info

Rakhitha Karunarathne

unread,
Sep 7, 2017, 4:40:05 AM9/7/17
to robocode-...@googlegroups.com
got it fixed. just downloaded those files manually.
Reply all
Reply to author
Forward
0 new messages