Bluetooth server

2010-06-02
2013-04-26
  • Hi,

    actually I'm trying to use Microlog bluetooth server. It seems that various articles are out-dated, most of them use a jar will all dependencies includes.

    I placed the necessary jars (bluecove-2.1.1-SNAPSHOT.jar / bluecove-gpl-2.1.1-SNAPSHOT.jar / microlog-server-bluetooth-3.0.0-SNAPSHOT.jar) in the same directory and tried to start the server with:
    java -cp .  net.sf.microlog.server.btspp.gui.MicrologBluetoothServerUI

    But the start aborts with:
    java.lang.NoClassDefFoundError: net/sf/microlog/server/btspp/gui/MicrologBluetoothServerUI
    Caused by: java.lang.ClassNotFoundException: net.sf.microlog.server.btspp.gui.MicrologBluetoothServerUI
            at java.net.URLClassLoader$1.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
    Could not find the main class: net.sf.microlog.server.btspp.gui.MicrologBluetoothServerUI.  Program will exit.

    Any hints?

    Thanks.

     
  • Johan Karlsson
    Johan Karlsson
    2010-06-02

    Hi,

    you need to add the jars to classpath as well. The java application is not smart enough to look for jars in the current directory.

    One good article on the subject is http://hansjar.blogspot.com/2009/06/using-microlog-over-bluetooth-with.html

    If you do not want to read the full article here is what the command line should look like:
    java -cp bluecove-2.1.1-SNAPSHOT.jar:bluecove-gpl-2.1.1-SNAPSHOT.jar:microlog-servers-2.0.0-SNAPSHOT-jar-with-dependencies.jar net.sf.microlog.server.btspp.gui.MicrologBluetoothServerUI

    Regards
    Johan

     
  • Jarle Hansen
    Jarle Hansen
    2010-06-02

    I have updated my blog with the changes made for the new version of microlog, http://hansjar.blogspot.com/2010/06/using-bluetooth-and-microlog-updated.html.

    This should solve your problem. This has been available a while, but not documented. That is my mistake I am afraid, sorry!
    Please let me know if you get it up and running.