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"这一行填入到配置块的顶部
ubuntu8.10下tinyos安装配置
最新推荐文章于 2024-09-17 19:04:05 发布