Loading...
Pages: [1]   Go Down
Author Topic: java.lang.NoClassDefFoundError when opening tools  (Read 607 times)
0 Members and 1 Guest are viewing this topic.
hanjo
Guest
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,
I am trying to run arduino on a g4 1ghz ibook. But every time I click on the tools menu I get the following message:

java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver

I believe it might be a conflict with the serial-libraries but I have no clue what to do. I have installed the handy cricket software as well, a similar problem seems to be described here: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1132256938/13#13

my System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/ext contains the following files:
apple_provider.jar      
localedata.jar          
sunpkcs11.jar
dnsns.jar              
sunjce_provider.jar

Has anyone any idea what to do?
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 7
Posts: 3532
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

When you run Arduino, what shows up in your console.log (run Console from Application > Utilities, click on "logs" and then on "console.log")?  You should have:

Experimental:  JNI_OnLoad called.
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version   = RXTX-2.1-7


Logged

hanjo
Guest
 Bigger Bigger  Smaller Smaller  Reset Reset

No. what I get is:

java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver
Experimental:  JNI_OnLoad called.
java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver

does that give you any clue?
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 7
Posts: 3532
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hmm.  I would try searching for files whose name contains "rxtx".  You might have a version of the RXTX library that uses the standard Sun class names instead of the gnu... class name used by the version of RXTX that Arduino uses.
Logged

hanjo
Guest
 Bigger Bigger  Smaller Smaller  Reset Reset

ok I looked for rxtx files:
locate rxtx
/Applications/arduino/librxtxSerial.jnilib
/Applications/arduino/librxtxSerial.jnilib.old
/Applications/Processing/libraries/serial/library/librxtxSerial.jnilib
/Applications/Processing/libraries/serial/library/librxtxSerial.so
/Applications/Processing/libraries/serial/library/rxtxSerial.dll
/Library/Java/Extensions/librxtxSerial.jnilib
/sw/fink/10.4-transitional/unstable/main/finkinfo/devel/rxtx-comm.info
/sw/fink/10.4-transitional/unstable/main/finkinfo/devel/rxtx-comm.patch

I have already tried to install the rxtx library form: http://users.frii.com/jarvi/rxtx/
I have tried the versions RXTX 2.1-7r2  and rxtx-2.0-7pre1

Can you tell me what files in which version should be where?
I am rather confused by the whole thing.
Logged

hanjo
Guest
 Bigger Bigger  Smaller Smaller  Reset Reset

ok I think I solved it. I just cleaned out my /Library/Java/Extensions/ Folder from all files with suspicious names. I just realized I forgot my arduino board at work so I can completely test it on Monday, but at least the ide is now starting without exception and I can choose a serial port in the tools menu.
Thanks a lot for your help.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm facing the same problem under Linux (Ubuntu 6.10) after following the installation process given at http://insitu.lri.fr/~labrune/web.jb.wiki/doku.php?id=arduino_on_ubuntu_linux

when I run arduino, I get in my console:
java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver
Experimental:  JNI_OnLoad called.
java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver


I've tried everything to make it work, ie I now have about 5 RXTXcomm.jar in my system, due tu the stange installation of Java Ubuntu does
I use java 1.5.0, at least it is what "java -version" tells me, because I seem to have also java 1.4.7 on my computer.

If anybody could help me configure RXTX installation properly and modify the CLASSPATH, and anything else that could make Arduino work ...

I got today my own Arduino card, and I am impatient to use it !!!

NB: this is my current RXTX installation for java 1.5
/usr/lib/jvm/java-1.5.0-sun/jre/lib/
librxtxParallel.so, librxtxSerial.so, javax.comm.properties
/usr/lib/jvm/java-1.5.0-sun/jre/lib/ext
RXTXcomm.jar

moving librxtxParallel.so and librxtxSerial.so to i386/ transforms the message into:
java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  SIGSEGV (0xb) at pc=0xb7f1cbf1, pid=15617, tid=3084609200
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_08-b03 mixed mode, sharing)
# Problematic frame:
# C  [ld-linux.so.2+0x9bf1]
#
# An error report file with more information is saved as hs_err_pid15617.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#



I don't know what to think of it ...
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 7
Posts: 3532
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

RXTX now comes with the Arduino distribution/source, so you shouldn't need to install it yourself.  Since you did, however, we can try to use that one.  Are there still any RXTX files in your Arduino directory?  If so, I would try deleting them.  Do you have comm.jar or jcl.jar anywhere on your system?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I shouldn't, indeed ... after deleting all the files on my system, I got Arduino working .... with the already compiled version
I don't understand why the HOWTO I read was explaining how to compile it, even though some CLASSPATH or Java stuff might be necessary to complete the installation ...
I can now use it without having to use Windows ... thanks a lot !
Logged

Pages: [1]   Go Up
Print
 
Jump to: