Rejecting re-init on previously failed class error when loading a Class with dalvikvm
Asked Answered
S

1

2

I am trying to use Terminal IDE on Lollipop 5.1.1. Using a Samsung E7 device, a mod version of Terminal IDE is provided by someone on XDA here: http://forum.xda-developers.com/showthread.php?t=1340852&page=7

I tried to use javac script in that mod but it gave an unsatisfied link error, saying that:

$ javac
java.lang.UnsatisfiedLinkError: org.apache.harmony.security.fortress.Services
       at             org.apache.harmony.security.fortress.Engine.getServices(Engine.java:158)
        at         org.apache.harmony.security.fortress.Engine.getInstance(Engine.java:137)
        at         java.security.cert.CertificateFactory.getInstance(CertificateFactory.java:90)
        at
    org.apache.harmony.security.utils.JarUtils.verifySignature(JarUtils.java:83)
        at     java.util.jar.JarVerifier.verifyCertificate(JarVerifier.java:294)
        at     java.util.jar.JarVerifier.readCertificates(JarVerifier.java:268)
        at     java.util.jar.JarFile.getInputStream(JarFile.java:380)
        at     libcore.net.url.JarURLConnectionImpl.getInputStream(JarURLConnectionImpl.java:222)
        at     java.net.URL.openStream(URL.java:470)
        at     java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:444)
        at     java.util.ResourceBundle.handleGetBundle(ResourceBundle.java:515)
        at     java.util.ResourceBundle.handleGetBundle(ResourceBundle.java:542)
        at     java.util.ResourceBundle.handleGetBundle(ResourceBundle.java:542)
        at     java.util.ResourceBundle.getBundle(ResourceBundle.java:228)
        at     java.util.ResourceBundle.getBundle(ResourceBundle.java:139)
        at     com.sun.tools.javac.main.JavaCompiler.version(JavaCompiler.java:112)
        at     com.sun.tools.javac.main.JavaCompiler.version(JavaCompiler.java:97)
        at     com.sun.tools.javac.main.Main.bugMessage(Main.java:434)
        at     com.sun.tools.javac.main.Main.compile(Main.java:421)
        at     com.sun.tools.javac.main.Main.compile(Main.java:308)
        at     com.sun.tools.javac.main.Main.compile(Main.java:299)
        at     com.sun.tools.javac.Main.compile(Main.java:82)
        at     com.spartacusrex.spartacuside.external.javac.main(javac.java:13)
    $

It is strange that there is a UnsatisfiedLinkError , because it doesn't say that VM cannot find xyz.so library or cannot find xyz method. I tried using logcat command right after using Terminal IDE's javac script on Device, the odd thing I found from there is :

I/art     ( 6558) : rejecting re-init on previously-failed class java.lang.Class<org.apache.harmony.security.fortress.Services>

I couldn't understand why this happened, The javac script uses android's dalvikvm command to load

com.spartacusrex.spartacuside.external.javac

class. People have faced this rejecting re-init issue on sdk version 20+ but it's not clear to me why this info message uccurs and how to solve it.

Savarin answered 5/2, 2016 at 5:7 Comment(0)
S
1

I copied /system/lib/libjavacrypto.so to Terminal IDE's ~/system/lib folder and now javac and dx tools are working. It seems like Google messed up with things in /system/lib which resulted in errors. Answering so someone else might find it useful.

Savarin answered 23/2, 2016 at 3:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.