天天看點

ubuntu8.10下tinyos安裝配置

ubuntu8.10下tinyos安裝配置:

一、配置好安裝好java6

二、安裝tinyos

一、配置好安裝好java6:

http://wiki.ubuntu.org.cn/Java安裝配置

ubuntu下Java6安裝配置

1) 安裝jdk,jre

sudo apt-get install sun-java6-jre

sudo apt-get install sun-java6-jdk

2) 設定目前預設的java解釋器

sudo update-alternatives --config java

執行後會出現類似如下的畫面:

There are 2 alternatives which provide `java’.

Selection Alternative

———————————————–

1 /usr/bin/gij-wrapper-4.1

*+ 2 /usr/lib/jvm/java-6-sun/jre/bin/java

Press enter to keep the default[*], or type selection number:

輸入前面的數字。如輸入2,然後回車确定。

3) 配置JAVA環境變量

sudo gedit /etc/environment

在其中添加如下兩行:

CLASSPATH=.:/usr/lib/jvm/java-6-sun/lib

JAVA_HOME=/usr/lib/jvm/java-6-sun

4) 添加配置

sudo gedit /etc/jvm

将檔案中的"/usr/lib/jvm/java-6-sun"這一行填入到配置塊的頂部

5) 安裝浏覽器的JAVA Plugin(可選)

sudo apt-get install sun-java6-plugin

二、安裝tinyos:

1) 添加源

sudo gedit /etc/apt/sources.list

Add the following line at the bottom of sources.list

deb http://tinyos.stanford.edu/tinyos/dists/ubuntu hardy main

2) 更新源

sudo apt-get update

3) 安裝tinyos

sudo apt-get install tinyosXXX

4) 把下面加入到~/.bashrc或者~/.profile檔案裡

sudo gedit ~/.bashrc

add the followings:

#Sourcing the tinyos environment variable setup script

source /opt/tinyos-2.1.XXXXX/tinyos.sh

export CLASSPATH=$TOSROOT/support/sdk/java/tinyos.jar:.

     /opt/tinyos-2.1.1/support/sdk/java/tinyos.jar

Save and exit the .bashrc file Next run the command

source ~/.bashrc

Run the following to prevent errors with java apps

sudo tos-install-jni

If you are getting any errors running make on the nesC files run the following...

sudo apt-get install g++

sudo apt-get install python2.5-dev

如果出現以下問題:

/opt/tinyos-2.1.0/support/sdk/java/net/tinyos/message/Message.java:84:

cannot find symbol

symbol : class SerialPacket

location: class net.tinyos.message.Message

private SerialPacket serialPacket;

^

...

可以将/opt/tinyos-2.1.0/tinyos.sh中

CLASSPATH=$CLASSPATH:$TOSROOT/support/sdk/java

改成

CLASSPATH=$CLASSPATH:$TOSROOT/support/sdk/java/tinyos.jar

試一試

python有問題,記得安裝python-dev,并且export PYTHONPATH=/opt/tinyos-2.1.0/support/sdk/python

如果你有eclipse,而且想用java-6-sum,需要做下面兩步

sudo gedit /etc/jvm

将檔案中的"/usr/lib/jvm/java-6-sun"這一行填入到配置塊的頂部