You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do not know if that library should work on android, but the test did not get good results.
package com.example.JavaDN;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
import org.xeustechnologies.jcl.JarClassLoader;
import org.xeustechnologies.jcl.JclObjectFactory;
import java.net.MalformedURLException;
import java.net.URL;
public class MainActivity extends Activity implements Runnable {
JarClassLoader mJcl;
TextView log;
/**
* Called when the activity is first created.
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mJcl = new JarClassLoader();
log = (TextView) findViewById(R.id.log);
new Thread(this).start();
}
@Override
public void run() {
log.setText("Loading lib...");
try {
mJcl.add(new URL("https://dl.dropboxusercontent.com/u/67269258/lib_class.jar"));
} catch (MalformedURLException e){
e.printStackTrace();
}
JclObjectFactory factory = JclObjectFactory.getInstance();
//Create object of loaded class
Object obj = factory.create(mJcl, "Math");
log.setText("ready! " + obj);
}
}
Error:
06-08 19:17:15.799 7604-7617/com.example.JavaDN E/dalvikvm﹕ ERROR: defineClass(0x4261d390, Math, 0x42691238, 0, 812)
06-08 19:17:15.799 7604-7617/com.example.JavaDN W/dalvikvm﹕ threadid=11: thread exiting with uncaught exception (group=0x41bef700)
06-08 19:17:15.804 7604-7617/com.example.JavaDN E/AndroidRuntime﹕ FATAL EXCEPTION: Thread-3011
org.xeustechnologies.jcl.exception.JclException: java.lang.UnsupportedOperationException: can't load this type of class file
at org.xeustechnologies.jcl.JclObjectFactory.create(JclObjectFactory.java:102)
at org.xeustechnologies.jcl.JclObjectFactory.create(JclObjectFactory.java:85)
at com.example.JavaDN.MainActivity.run(MainActivity.java:44)
at java.lang.Thread.run(Thread.java:841)
Caused by: java.lang.UnsupportedOperationException: can't load this type of class file
at java.lang.VMClassLoader.defineClass(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:292)
at java.lang.ClassLoader.defineClass(ClassLoader.java:256)
at org.xeustechnologies.jcl.JarClassLoader.access$000(JarClassLoader.java:50)
at org.xeustechnologies.jcl.JarClassLoader$LocalLoader.loadClass(JarClassLoader.java:254)
at org.xeustechnologies.jcl.AbstractClassLoader.loadClass(AbstractClassLoader.java:122)
at org.xeustechnologies.jcl.AbstractClassLoader.loadClass(AbstractClassLoader.java:95)
at org.xeustechnologies.jcl.JclObjectFactory.create(JclObjectFactory.java:100)
at org.xeustechnologies.jcl.JclObjectFactory.create(JclObjectFactory.java:85)
at com.example.JavaDN.MainActivity.run(MainActivity.java:44)
at java.lang.Thread.run(Thread.java:841)
The text was updated successfully, but these errors were encountered:
Do not know if that library should work on android, but the test did not get good results.
Error:
The text was updated successfully, but these errors were encountered: