pc samples problem with bluetooth

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: 99jonathan, roger, imaqine

pc samples problem with bluetooth

Postby ChristopheNS » Mon Jun 16, 2014 6:30 pm

Hello,

I'm trying to connect NXT with my PC through java sample programs. I've tried to connect it with nxjbrowse, no problem, it works.
When I would like to connect the NXT to the PC I obtain this error :
Error
Code: Select all
X@X:/opt/lejos_nxj/pcsamples/src$ java org.lejos.pcsample.sensortest.SensorTest
Exception in thread "main" java.lang.ExceptionInInitializerError
   at org.lejos.pcsample.sensortest.SensorTest.main(SensorTest.java:17)
Caused by: java.lang.ClassCastException: javax.microedition.io.Connector$1 cannot be cast to javax.microedition.io.StreamConnection
   at lejos.pc.comm.NXTCommBluecove.open(NXTCommBluecove.java:129)
   at lejos.pc.comm.NXTConnector.connectTo(NXTConnector.java:280)
   at lejos.pc.comm.NXTConnector.connectTo(NXTConnector.java:239)
   at lejos.pc.comm.NXTConnector.connectTo(NXTConnector.java:42)
   at lejos.pc.comm.NXTCommandConnector.open(NXTCommandConnector.java:23)
   at lejos.pc.comm.NXTCommandConnector.getSingletonOpen(NXTCommandConnector.java:41)
   at lejos.nxt.SensorPort.<clinit>(SensorPort.java:17)
   ... 1 more


My configuration :ubuntu 12.04 64 bits
I don't use Eclipse, I compile in command line
Code: Select all
X@X:/opt/lejos_nxj/pcsamples/src$ java -version
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)


The Classpath
Code: Select all
X@X:/opt/lejos_nxj/pcsamples/src$ echo $CLASSPATH | grep classes
/opt/lejos_nxj/lib/pc/3rdparty/lib/commons-cli.jar:/opt/lejos_nxj/lib/pc/3rdparty/lib/bluecove-gpl-src.jar:/opt/lejos_nxj/lib/pc/3rdparty/lib/bluecove-gpl.jar:/opt/lejos_nxj/lib/pc/3rdparty/lib/bluecove.jar:/opt/lejos_nxj/lib/pc/3rdparty/lib/bcel.jar:/opt/lejos_nxj/lib/pc/pctools.jar:/opt/lejos_nxj/lib/pc/pccomm.jar:/opt/lejos_nxj/lib/pc/jtools.jar:/opt/lejos_nxj/lib/nxt/classes.jar:/opt/lejos_nxj/lib/nxt/bluecove-gpl-src.jar:/opt/lejos_nxj/lib/nxt/bluecove-gpl.jar:/opt/lejos_nxj/lib/nxt/bluecove.jar:/opt/lejos_nxj/bin:


I've tried to remove classes.jar from the CLASSPATH (side pc)

I thank you to help me to try the the solution.

Christophe
ChristopheNS
New User
 
Posts: 6
Joined: Sat Nov 23, 2013 2:43 pm

Re: pc samples problem with bluetooth

Postby ChristopheNS » Mon Jun 16, 2014 7:37 pm

Hello,

I've found the problem. I removed class.jar and I restart the computer instead of : source ~/.bashrc , it's work fine.

Hope this helps!

Christophe
ChristopheNS
New User
 
Posts: 6
Joined: Sat Nov 23, 2013 2:43 pm


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 4 guests

more stuff