berkus / android-apktool

Automatically exported from code.google.com/p/android-apktool
Other
1 stars 0 forks source link

apktool.jar is not runnable from java 5 standard VM #206

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It seems that apktool.jar has been compiled with the only java 6  bytecode 
compatibility.

Consequently it's not possible to run this jar under java 5 standard VM.

> java -version
java version "1.5.0_22"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_22-b03)
Java HotSpot(TM) Client VM (build 1.5.0_22-b03, mixed mode, sharing)

> java -jar apktool.jar 
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version 
number in .class file
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)

To fix that issue, you can pass the 1.5 value instead of 6 in your 
maven-compiler-plugin in the target configuration :

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>6</source>
                    <target>1.5</target>
                </configuration>
            </plugin>

Original issue reported on code.google.com by mat.boni...@gmail.com on 18 Aug 2011 at 9:48

GoogleCodeExporter commented 9 years ago
Issue 200 has been merged into this issue.

Original comment by Brut.alll on 5 Nov 2011 at 9:55

GoogleCodeExporter commented 9 years ago
Java 5 is pretty old and I don't think it makes much sense to support it. Also 
anyone can download apktool sources and build it for 1.5 .

Original comment by Brut.alll on 5 Nov 2011 at 10:01