BlueCove troubles on Mac OSX

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

Moderators: 99jonathan, roger, imaqine

BlueCove troubles on Mac OSX

Postby chrismikehogan » Sat Mar 24, 2012 11:32 pm

I have been trying to get the BTSend/BTReceive samples to work, but have hit a wall.

BTReceive uploads to my brick over bluetooth no problem, but when I run BTSend on my PC, I get the following output:

Code: Select all
Native Library bluecove not available
BTSend Log.listener: Error: Exception connecting to NXT.
BTSend Log.listener: Caused by lejos.pc.comm.NXTCommException: Open of NXT failed.
BTSend Log.listener:    at lejos.pc.comm.NXTCommBluecove.open(NXTCommBluecove.java:136)
BTSend Log.listener: Caused by javax.bluetooth.BluetoothStateException: BlueCove library bluecove not available
BTSend Log.listener:    at com.intel.bluetooth.BlueCoveImpl.loadNativeLibraries(BlueCoveImpl.java:381)
BTSend Log.listener: Failed to connect to any NXT
Failed to connect to any NXT


pccomm.jar and bluecove.jar are both in the classpath of the project. Further, I the 32bit Java priority over 64, but still no luck.

I'm using java 1.6, leJOS 0.9.1, and Mac OS 10.7.3

Any advice would be so much appreciated!
chrismikehogan
New User
 
Posts: 6
Joined: Sat Mar 24, 2012 11:26 pm

Re: BlueCove troubles on Mac OSX

Postby skoehler » Sun Mar 25, 2012 9:41 am

try passing -d32 to the JVM (nxjpc command does that automatically)
Not sure, whether giving 32bit priority over 64bit always works. Something may override it.
skoehler
leJOS Team Member
 
Posts: 1430
Joined: Thu Oct 30, 2008 4:54 pm

Re: BlueCove troubles on Mac OSX

Postby pepijndevos » Mon Mar 26, 2012 9:52 am

java -version should tell you that, unless you have LEJOS_NXT_JAVA_HOME or JAVA_HOME set to somewhere else. In that case, $JAVA_HOME/bin/java -version is the correct command.
pepijndevos
New User
 
Posts: 24
Joined: Fri May 14, 2010 8:56 am

Re: BlueCove troubles on Mac OSX

Postby chrismikehogan » Wed Mar 28, 2012 4:50 pm

A couple more developments:

Full disclosure, I am new to Java and have been using Eclipse with the leJOS plugin.

When I try and use command line tools (whether java or nxjpc), get a NoClassDefFoundError (output below). I do not get this runtime error when using Eclipse (but do of course get the errors mentioned above).

Further, when I run the ant build/run from /Users/me/leJOS_NXJ/samples/pcsamples, BTSend works perfectly.

Code: Select all
Exception in thread "main" java.lang.NoClassDefFoundError: src/org/lejos/pcsample/btsend/BTSend (wrong name: org/lejos/pcsample/btsend/BTSend)
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
   at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
   at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
chrismikehogan
New User
 
Posts: 6
Joined: Sat Mar 24, 2012 11:26 pm

Re: BlueCove troubles on Mac OSX

Postby chrismikehogan » Wed Mar 28, 2012 4:52 pm

Also, for what it's worth, this is the output of java -version (which confirms that java is running in 64bit):

Code: Select all
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-11D50b)
Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)
chrismikehogan
New User
 
Posts: 6
Joined: Sat Mar 24, 2012 11:26 pm

Re: BlueCove troubles on Mac OSX

Postby skoehler » Wed Mar 28, 2012 5:06 pm

Are you trying to execute one of the pcsamples? Try installing and using ant. It will be much easier for you and we can see if it works at all. Just execute the "ant" command in the pcsamples directory.
Also, the NoClassDefFoundError exception showed that you were trying to start the class src.org.lejos.pcsample.btsend.BTSend. However, the class is called org.lejos.pcsample.btsend.BTSend (without the src. in front).

In eclipse, you might have to edit the run configuration and add the "-d32" to the VM parameters.
When I have some time and I have access to a Mac, I will try executing the samples on OS X.
skoehler
leJOS Team Member
 
Posts: 1430
Joined: Thu Oct 30, 2008 4:54 pm

Re: BlueCove troubles on Mac OSX

Postby chrismikehogan » Thu Mar 29, 2012 2:00 pm

Building and running the BTSend sample using ant worked. Also, managed to use the right name and run it with java.

Thanks for all of your help!
chrismikehogan
New User
 
Posts: 6
Joined: Sat Mar 24, 2012 11:26 pm

Re: BlueCove troubles on Mac OSX

Postby balajig » Fri May 11, 2012 6:20 am

Hi, I get a similar error in eclipse while trying to upload the programs. It works fine from the command line. Was anyone able to solve this issue?
balajig
New User
 
Posts: 1
Joined: Fri May 11, 2012 6:17 am


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 2 guests

more stuff