Export to GitHub

jarjar - issue #1

1.0rc4 compiled against java5 (for a reason?)


Posted on Jul 4, 2007 by Helpful Ox

What steps will reproduce the problem? 1. Download jarjar-1.0rc4.jar 2. Try to use it with jvm 1.4

What is the expected output? What do you see instead? The jarjar task in my build file work :)

The output is: BUILD FAILED java.lang.UnsupportedClassVersionError: com/tonicsystems/jarjar/JarJarTask (Unsupported major.minor version 49.0)

Total time: 1 second toomasr@cigarette:~/weaver$ java -version java version "1.4.2_10" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_10-b03) Java HotSpot(TM) Client VM (build 1.4.2_10-b03, mixed mode)

What version of the product are you using? On what operating system? 1.0rc4

Comment #1

Posted on Jul 4, 2007 by Helpful Ox

Checked out the source to search for your email address because when I started hosting a project@code.google I did not get emails about added issues and had to enable it from somewhere.

Anyways I compiled it with jdk1.4 and can use the updated the version. Hopefully the final version will be compiled against 1.4 as it did compile with 1.4 at the moment. I've added a build.xml diff although it is easier just to go in and change the 2 lines by hand.

Nice tool, thx :)

Attachments

Comment #2

Posted on Jul 5, 2007 by Massive Panda

Previously jarjar would run on JDK 1.2+. Because the license has changed to Apache 2 I had to remove the use of GNU classes and switch to Java regexps, which are in 1.4+. I figured that I might as well just make it 1.5 and then I could rewrite jarjar using generics, annotations, etc.

Can I ask why you need to use jarjar in a 1.4 environment? Perhaps I will investigate retroweaver. In the meantime I'll make sure that rc5 is 1.4 compatible.

Comment #3

Posted on Jul 5, 2007 by Helpful Ox

The project I'm involved in uses jdk1.4. I have different jdks installed and can compile everything for the targets I'm interested in (1.4 in this case) whichever > 1.4 jdk I use. So I don't have to use jarjar in a 1.4 environment, I just have to reconfigure a bit my system.

As this is a big step (jdk1.4 -> java5) for rc3->rc4 (probably one of the last RC's before release) and did not notice a changelog (well i did not search for it, it is usually thrown in the face :) ) stating the change I figured it must have happened by mistake.

Until you start using the features Java5 offers please maintain 1.4 compatibility as more users will have a better out-of-the-box experience.

Comment #4

Posted on Jul 5, 2007 by Massive Panda

I've uploaded rc5 which is the same as rc4 but compiled to JDK-1.4-compatible bytecode. I've also added a changelog which is linked from the home page.

I will revisit upgrading to 1.5 for jarjar 1.1.

Comment #5

Posted on Nov 20, 2007 by Happy Rhino

Comment deleted

Comment #6

Posted on Nov 20, 2007 by Happy Rhino

In addition, it seems to me 1.0rc6 can't scan jars that were built under 1.6? I'm getting:

Exception in thread "main" java.lang.IllegalStateException: ClassReader.accept() should be called with EXPAND_FRAMES flag at com.tonicsystems.jarjar.asm.commons.LocalVariablesSorter.visitFrame at com.tonicsystems.jarjar.asm.commons.RemappingMethodAdapter.visitFrame at com.tonicsystems.jarjar.asm.ClassReader.accept at com.tonicsystems.jarjar.asm.ClassReader.accept at com.tonicsystems.jarjar.DepFind.run(DepFind.java:56) at com.tonicsystems.jarjar.Main.find(Main.java:72) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke at sun.reflect.DelegatingMethodAccessorImpl.invoke at java.lang.reflect.Method.invoke(Method.java:597) at com.tonicsystems.jarjar.IoUtils.runMain(IoUtils.java:98) at com.tonicsystems.jarjar.Main.main(Main.java:40)

Status: Fixed

Labels:
Type-Defect Priority-Medium