简体   繁体   中英

Running Java app from inside emacs using JDEE throws NoClassDefFoundError

I have configured JDEE in emacs. But when I try to run any App, it throws NoClassDefFoundError . Upon compilation, although a class file is created, it only shows the buffer for sometime and then closes it.

The same files if compiled and run from the terminal work perfectly fine.

Also, on this machine I have java-6-openjdk installed. I had configured JDEE on my home computer which has sun java jdk and there are no such problems there.

Other than this, features such as code completion, generation etc work fine.

How do I solve this? Is this due to open jdk ?

I am using a Ubuntu 10.04 desktop.

This is the stack trace

cd /home/vineet/java/KodeJava/src/org/kodeplay/kodejava/
/usr/lib/jvm/java-6-openjdk/bin/java org.kodeplay.kodejava.EmacsTest

Exception in thread "main" java.lang.NoClassDefFoundError: org/kodeplay/kodejava/EmacsTest
Caused by: java.lang.ClassNotFoundException: org.kodeplay.kodejava.EmacsTest
    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: org.kodeplay.kodejava.EmacsTest. Program will exit.

Process org.kodeplay.kodejava.EmacsTest exited abnormally with code 1

Thanks

From the question, it sounds as if the JDEE configuration is not complete when it comes to setting up the command to be launched when running the Java App.

If the same Java App can be run from the terminal with no issues, OpenJDK is not causing the trouble, I'd wager.

Perhaps you copied over from the other computer the JDEE configurations and did not adopt them for the new computer that has OpenJDK.

something in your config is wrong. you are trying to run from the "/home/vineet/java/KodeJava/src/org/kodeplay/kodejava/" directory, but in order to find your class on the classpath, you should be running from "/home/vineet/java/KodeJava/src/". Probably need to configure the "jde-run-working-directory" variable.

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