天宮鏡花 天宮鏡花 - 2 months ago 14
Java Question

Some problems on tinyos on the lesson Mote-PC serial communication

I'm now facing some problems maybe about java when learning tinyos.

Here is the picture

Also there is some settings about my java and the tinyos.sh

//.bashrc
# Start TinyOS environment pathing
export TOSROOT=/opt/tinyos-2.1.2
export TOSDIR=$TOSROOT/tos
export CLASSPATH=$TOSROOT/support/sdk/java/tinyos.jar:.$CLASSPATH
export MAKERULES=$TOSROOT/support/make/Makerules
export PATH=/opt/msp430/bin:$PATH
source /opt/tinyos-2.1.2/tinyos.sh
# End TinyOS pathing

export JAVA_HOME=/usr/local/java/jdk1.8.0
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH

# TinyOS 2.1.2 Configuration Guide
# Here we setup the environment
# variables needed by the tinyos
# make system

echo "Setting up for TinyOS 2.1.2"
export TOSROOT="/opt/tinyos-2.1.2"
export TOSDIR="$TOSROOT/tos"
export MAKERULES="$TOSROOT/support/make/Makerules"
export PYTHONPATH=$PYTHONPATH:$TOSROOT/support/sdk/python
exportCLASSPATH=
$CLASSPATH:$TOSROOT/support/sdk/java:.:$TOSROOT/support/sdk/java/tinyos.jar


If any suggestion, please tell me.

Answer

Your problem pretty much lies in your classpath, try:

CLASSPATH="$TOSROOT/support/sdk/java/tinyos.jar:$TOSROOT/support/sdk/java:$TOSROOT
        /support/sdk/java/net/tinyos:{Insert_folder_where_NesC_Is}/nesc-1.3.4/tools:."

The classpath above should pretty much cover every java related thing you could possibly need.