简体   繁体   中英

java.lang.NoClassDefFoundError: org/python/util/PythonInterpreter

trying to use jython in my android project but whenever i start the application i get the following error message:

09-29 01:04:24.841: E/AndroidRuntime(2212): FATAL EXCEPTION: Thread-11144
09-29 01:04:24.841: E/AndroidRuntime(2212): Process: com.spitmarks.spitman, PID: 2212
09-29 01:04:24.841: E/AndroidRuntime(2212): java.lang.NoClassDefFoundError:     org/python/util/PythonInterpreter
09-29 01:04:24.841: E/AndroidRuntime(2212):     at      com.spitmarks.spitman.TestPythonClass.TestMetoda(TestPythonClass.java:8)
09-29 01:04:24.841: E/AndroidRuntime(2212):     at com.spitmarks.spitman.MainMenuScreen.paint(MainMenuScreen.java:89)
09-29 01:04:24.841: E/AndroidRuntime(2212):     at com.spitman.framework.implementation.AndroidFastRenderView.run(AndroidFastRenderView.java:49)
09-29 01:04:24.841: E/AndroidRuntime(2212):     at java.lang.Thread.run(Thread.java:841)
09-29 01:04:24.841: E/AndroidRuntime(2212): Caused by: java.lang.ClassNotFoundException: Didn't find class "org.python.util.PythonInterpreter" on path: DexPathList[[zip file "/data/app/com.spitmarks.spitman-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.spitmarks.spitman-2, /vendor/lib, /system/lib]]
09-29 01:04:24.841: E/AndroidRuntime(2212):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
09-29 01:04:24.841: E/AndroidRuntime(2212):     at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
09-29 01:04:24.841: E/AndroidRuntime(2212):     at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
09-29 01:04:24.841: E/AndroidRuntime(2212):     ... 4 more

I am using Win8, Eclipse Kepler, Android SDK 23.

Specified Java class can be found in jython install folder.

PS And when i try to debug i get the screen with description that i can not access source code of BaseDexClassLoader.class, and i cant even find it anywhere on my OS.

Every help is greatly appreciated.

UPDATE:

package com.spi.spit;

import org.python.util.PythonInterpreter;
import org.python.core.*;

public class JythonTestClass {
    public static String Test() throws PyException {
        PythonInterpreter interp = new PythonInterpreter();

        return "";
    }
}

This the method i am calling and trying to use in the app (and it breaks while running on the phone)

You have the JAR on your classpath when compiling and running Jython

  • Right click project
  • select property
  • select add external jar
  • clean, build and run

here is a screenshot:

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM