Hi,

The Java libraries have some problems compiling on a clean system. Is there a precompiled tinyos.jar file in your directory (/opt/tinyos-2.x/support/sdk/java/tinyos.jar)? If so, you could try to change your classpath to this directory. Your classpath should also include the current directory (shown as a .).

If you use Linux, you can try this:

export CLASSPATH=".:/opt/tinyos-2.x/support/sdk/java/tinyos.jar"

If this works, you should modify your tinyos.sh script.

Cheers,
Urs


On 12/10/10 3:09 AM, hongliping7123 wrote:
Thank you for your answer!
There are the answer for your question:
first, What is the output of the command "echo $CLASSPATH"?
It is "/opt/tinyos-2.x/support/sdk/java"
when I type "echo $CLASSPATH"
second, Which operating system are you using?
*The OS version I used is TinyOS2.1.0*
Third , How did you install TinyOS?
*http://wenku.baidu.com/view/2cc6ed0cba1aa8114431d911.html*
*I install TinyOS as the above website said!*
*And when I type the command "make" in the directory 
"/opt/tinyos-2.x/support/sdk/java" , It also show a lot of errors! ( I uses Cygwin in 
windows):*
?????? ?? net.tinyos.mviz.DDocument.DrawTableModel
         public void remove(DMoteModel model){
                            ^
DDocument.java:381: ??????????
?????? ?? DMoteModel
?????? ?? net.tinyos.mviz.DDocument.DrawTableModel
         private int findModel(DMoteModel changed){
                               ^
DDocument.java:142: ??????????
?????? ?? DNavigate
?????? ?? net.tinyos.mviz.DDocument
         navigator = new DNavigate(sensed_motes, sensed_links, this);
                         ^
DDocument.java:190: ??????????
?????? ?? DMoteModel
?????? ?? net.tinyos.mviz.DDocument
         DMoteModel m = new DMoteModel(moteID, rand, this);
         ^
DDocument.java:190: ??????????
?????? ?? DMoteModel
?????? ?? net.tinyos.mviz.DDocument
         DMoteModel m = new DMoteModel(moteID, rand, this);
                            ^
DDocument.java:207: ??????????
?????? ?? DLinkModel
?????? ?? net.tinyos.mviz.DDocument
         DLinkModel dl = new DLinkModel(start, end, rand, this);
         ^
DDocument.java:207: ??????????
?????? ?? DLinkModel
?????? ?? net.tinyos.mviz.DDocument
         DLinkModel dl = new DLinkModel(start, end, rand, this);
                             ^
DDocument.java:226: ??????????
?????? ?? DMoteModel
?????? ?? net.tinyos.mviz.DDocument
             DMoteModel m = (DMoteModel)moteIndex.get(new Integer(moteID));
             ^
DDocument.java:226: ??????????
?????? ?? DMoteModel
?????? ?? net.tinyos.mviz.DDocument
             DMoteModel m = (DMoteModel)moteIndex.get(new Integer(moteID));
                             ^
DDocument.java:240: ??????????
?????? ?? DMoteModel
?????? ?? net.tinyos.mviz.DDocument
             DMoteModel m = (DMoteModel)moteIndex.get(new Integer(startMote));
             ^
DDocument.java:240: ??????????
?????? ?? DMoteModel
?????? ?? net.tinyos.mviz.DDocument
             DMoteModel m = (DMoteModel)moteIndex.get(new Integer(startMote));
                             ^
DDocument.java:244: ??????????
?????? ?? DMoteModel
?????? ?? net.tinyos.mviz.DDocument
             DMoteModel m2 = (DMoteModel)moteIndex.get(new Integer(endMote));
             ^
DDocument.java:244: ??????????
?????? ?? DMoteModel
?????? ?? net.tinyos.mviz.DDocument
             DMoteModel m2 = (DMoteModel)moteIndex.get(new Integer(endMote));
                              ^
DDocument.java:248: ??????????
?????? ?? DLinkModel
?????? ?? net.tinyos.mviz.DDocument
             DLinkModel dl = (DLinkModel)linkIndex.get(startMote + " " + 
endMote)
;
             ^
DDocument.java:248: ??????????
?????? ?? DLinkModel
?????? ?? net.tinyos.mviz.DDocument
             DLinkModel dl = (DLinkModel)linkIndex.get(startMote + " " + 
endMote)
;
                              ^
DDocument.java:295: ??????????
?????? ?? DataModel
?????? ?? net.tinyos.mviz.DDocument
         DataModel model = new DataModel(packetVector);
         ^
DDocument.java:295: ??????????
?????? ?? DataModel
?????? ?? net.tinyos.mviz.DDocument
         DataModel model = new DataModel(packetVector);
                               ^
DDocument.java:303: ??????????
?????? ?? MessageInput
?????? ?? net.tinyos.mviz.DDocument
         MessageInput input = new MessageInput(packetVector, source, doc);
         ^
DDocument.java:303: ??????????
?????? ?? MessageInput
?????? ?? net.tinyos.mviz.DDocument
         MessageInput input = new MessageInput(packetVector, source, doc);
                                  ^
DDocument.java:310: ??????????
?????? ?? DMoteModel
?????? ?? net.tinyos.mviz.DDocument
             ((DMoteModel)it.next()).requestRepaint();
               ^
DDocument.java:316: ??????????
?????? ?? DLink
?????? ?? net.tinyos.mviz.DDocument
             ((DLink)it.next()).repaint();
               ^
DDocument.java:350: ??????????
?????? ?? DMoteModel
?????? ?? net.tinyos.mviz.DDocument.DrawTableModel
             DMoteModel model = (DMoteModel) DDocument.this.motes.get(row);
             ^
DDocument.java:350: ??????????
?????? ?? DMoteModel
?????? ?? net.tinyos.mviz.DDocument.DrawTableModel
             DMoteModel model = (DMoteModel) DDocument.this.motes.get(row);
                                 ^
DDocument.java:383: ??????????
?????? ?? DMoteModel
?????? ?? net.tinyos.mviz.DDocument.DrawTableModel
                 if ((DMoteModel)DDocument.this.motes.get(i) == changed)
                      ^
DDocument.java:408: ??????????
?????? ?? DMoteModel
                             DMoteModel model = (DMoteModel)it.next();
                             ^
DDocument.java:408: ??????????
?????? ?? DMoteModel
                             DMoteModel model = (DMoteModel)it.next();
                                                 ^
DDocument.java:411: ?????? + ?????????? DMoteModel.getLocX,int
                                             model.getLocX() + 20)&&
                                                          ^
DDocument.java:409: ??????  ???? withinRange(int,int,int) ?????? (int,int,<nullt
ype>)
                             if (withinRange(e.getX(),
                                 ^
DDocument.java:414: ?????? + ?????????? DMoteModel.getLocY,int
                                             model.getLocY() + 20)) {
                                                          ^
DDocument.java:412: ??????  ???? withinRange(int,int,int) ?????? (int,int,<nullt
ype>)
                                 withinRange(e.getY(),
                                 ^
DDocument.java:444: ?????? + ?????????? DMoteModel.getLocX,int
                             selected.move(selected.getLocX() + dx, 
selected.getL
ocY() + dy);
                                                           ^
DDocument.java:444: ?????? + ?????????? DMoteModel.getLocY,int
                             selected.move(selected.getLocX() + dx, 
selected.getL
ocY() + dy);

    ^
??????DDocument.java ??????????????????????????????
???????????????????????????? -Xlint:unchecked ??????????
44 ????
make[3]: *** [DDocument.class] Error 1
make[3]: Leaving directory `/opt/tinyos-2.x/support/sdk/java/net/tinyos/mviz'
make[3]: Entering directory `/opt/tinyos-2.x/support/sdk/java/net/tinyos/sim'
... /opt/tinyos-2.x/support/sdk/java/net/tinyos/sim
make[3]: Leaving directory `/opt/tinyos-2.x/support/sdk/java/net/tinyos/sim'
make[3]: Entering directory `/opt/tinyos-2.x/support/sdk/java/net/tinyos/tools'
... /opt/tinyos-2.x/support/sdk/java/net/tinyos/tools
mig java  -java-classname=net.tinyos.tools.PrintfMsg /opt/tinyos-2.x/tos/lib/pri
ntf/printf.h printf_msg -o PrintfMsg.java
javac PrintfMsg.java
PrintfMsg.java:9: ?????? net.tinyos.message ??????
public class PrintfMsg extends net.tinyos.message.Message {
                                                  ^
PrintfMsg.java:69: ?????? net.tinyos.message ??????
     public PrintfMsg(net.tinyos.message.Message msg, int base_offset) {
                                        ^
PrintfMsg.java:78: ?????? net.tinyos.message ??????
     public PrintfMsg(net.tinyos.message.Message msg, int base_offset, int 
data_l
ength) {
                                        ^
PrintfMsg.java:20: ??????????
?????? ???? amTypeSet(int)
?????? ?? net.tinyos.tools.PrintfMsg
         amTypeSet(AM_TYPE);
         ^
PrintfMsg.java:26: ??????????
?????? ???? amTypeSet(int)
?????? ?? net.tinyos.tools.PrintfMsg
         amTypeSet(AM_TYPE);
         ^
PrintfMsg.java:35: ??????????
?????? ???? amTypeSet(int)
?????? ?? net.tinyos.tools.PrintfMsg
         amTypeSet(AM_TYPE);
         ^
PrintfMsg.java:44: ??????????
?????? ???? amTypeSet(int)
?????? ?? net.tinyos.tools.PrintfMsg
         amTypeSet(AM_TYPE);
         ^
PrintfMsg.java:53: ??????????
?????? ???? amTypeSet(int)
?????? ?? net.tinyos.tools.PrintfMsg
         amTypeSet(AM_TYPE);
         ^
PrintfMsg.java:62: ??????????
?????? ???? amTypeSet(int)
?????? ?? net.tinyos.tools.PrintfMsg
         amTypeSet(AM_TYPE);
         ^
PrintfMsg.java:71: ??????????
?????? ???? amTypeSet(int)
?????? ?? net.tinyos.tools.PrintfMsg
         amTypeSet(AM_TYPE);
         ^
PrintfMsg.java:80: ??????????
?????? ???? amTypeSet(int)
?????? ?? net.tinyos.tools.PrintfMsg
         amTypeSet(AM_TYPE);
         ^
PrintfMsg.java:166: ??????????
?????? ???? getUIntBEElement(int,int)
?????? ?? net.tinyos.tools.PrintfMsg
         return (short)getUIntBEElement(offsetBits_buffer(index1), 8);
                       ^
PrintfMsg.java:173: ??????????
?????? ???? setUIntBEElement(int,int,short)
?????? ?? net.tinyos.tools.PrintfMsg
         setUIntBEElement(offsetBits_buffer(index1), 8, value);
         ^
PrintfMsg.java:245: ?????? net.tinyos.message ??????
          char carr[] = new 
char[Math.min(net.tinyos.message.Message.MAX_CONVERTE
D_STRING_LENGTH,28)];
                                                            ^
14 ????
make[3]: *** [PrintfMsg.class] Error 1
make[3]: Leaving directory `/opt/tinyos-2.x/support/sdk/java/net/tinyos/tools'
make[3]: Entering directory `/opt/tinyos-2.x/support/sdk/java/net/tinyos/util'
... /opt/tinyos-2.x/support/sdk/java/net/tinyos/util
javac DiagMsg.java
DiagMsg.java:26: ?????? net.tinyos.packet ??????
import net.tinyos.packet.*;
^
DiagMsg.java:27: ??????????
?????? ?? PrintStreamMessenger
?????? ?????? net.tinyos.util
import net.tinyos.util.PrintStreamMessenger;
                       ^
DiagMsg.java:29: ??????????
?????? ?? PacketListenerIF
public class DiagMsg implements PacketListenerIF {
                                 ^
DiagMsg.java:40: ??????????
?????? ?? PhoenixSource
?????? ?? net.tinyos.util.DiagMsg
     protected PhoenixSource forwarder;
               ^
DiagMsg.java:42: ??????????
?????? ?? PhoenixSource
?????? ?? net.tinyos.util.DiagMsg
     public DiagMsg(PhoenixSource forwarder)
                    ^
DiagMsg.java:55: ??????????
?????? ?? PhoenixSource
?????? ?? net.tinyos.util.DiagMsg
                 PhoenixSource phoenix = null;
                 ^
DiagMsg.java:58: ??????????
?????? ???? PrintStreamMessenger
?????? ?? net.tinyos.util.DiagMsg
                         phoenix = 
BuildSource.makePhoenix(PrintStreamMessenger.e
rr);
                                                           ^
DiagMsg.java:58: ??????????
?????? ???? BuildSource
?????? ?? net.tinyos.util.DiagMsg
                         phoenix = 
BuildSource.makePhoenix(PrintStreamMessenger.e
rr);
                                   ^
DiagMsg.java:60: ??????????
?????? ???? PrintStreamMessenger
?????? ?? net.tinyos.util.DiagMsg
                         phoenix = BuildSource.makePhoenix(args[1], 
PrintStreamMe
ssenger.err);
                                                                    ^
DiagMsg.java:60: ??????????
?????? ???? BuildSource
?????? ?? net.tinyos.util.DiagMsg
                         phoenix = BuildSource.makePhoenix(args[1], 
PrintStreamMe
ssenger.err);
                                   ^
10 ????
make[3]: *** [DiagMsg.class] Error 1
make[3]: Leaving directory `/opt/tinyos-2.x/support/sdk/java/net/tinyos/util'
make[2]: *** [subdirs] Error 2
make[2]: Leaving directory `/opt/tinyos-2.x/support/sdk/java/net/tinyos'
make[1]: *** [subdirs] Error 2
make[1]: Leaving directory `/opt/tinyos-2.x/support/sdk/java/net'
make: *** [subdirs] Error 2
*And I compile TestSerial application , the errors are:*
*administra...@hongliping /opt/tinyos-2.x/apps/tests/TestSerial*
$ make telosb
mkdir -p build/telosb
javac -target 1.4 -source 1.4 *.java
TestSerial.java:35: ?????? net.tinyos.message ??????
import net.tinyos.message.*;
^
TestSerial.java:36: ?????? net.tinyos.packet ??????
import net.tinyos.packet.*;
^
TestSerial.java:37: ?????? net.tinyos.util ??????
import net.tinyos.util.*;
^
TestSerial.java:39: ??????????
?????? ?? MessageListener
public class TestSerial implements MessageListener {
                                    ^
TestSerial.java:41: ??????????
?????? ?? MoteIF
?????? ?? TestSerial
   private MoteIF moteIF;
           ^
TestSerial.java:43: ??????????
?????? ?? MoteIF
?????? ?? TestSerial
   public TestSerial(MoteIF moteIF) {
                     ^
TestSerial.java:68: ??????????
?????? ?? Message
?????? ?? TestSerial
   public void messageReceived(int to, Message message) {
                                       ^
TestSerialMsg.java:7: ?????? net.tinyos.message ??????
public class TestSerialMsg extends net.tinyos.message.Message {
                                                      ^
TestSerialMsg.java:67: ?????? net.tinyos.message ??????
     public TestSerialMsg(net.tinyos.message.Message msg, int base_offset) {
                                            ^
TestSerialMsg.java:76: ?????? net.tinyos.message ??????
     public TestSerialMsg(net.tinyos.message.Message msg, int base_offset, int 
da
ta_length) {
                                            ^
TestSerial.java:91: ??????????
?????? ?? PhoenixSource
?????? ?? TestSerial
     PhoenixSource phoenix;
     ^
TestSerial.java:94: ??????????
?????? ???? PrintStreamMessenger
?????? ?? TestSerial
       phoenix = BuildSource.makePhoenix(PrintStreamMessenger.err);
                                         ^
TestSerial.java:94: ??????????
?????? ???? BuildSource
?????? ?? TestSerial
       phoenix = BuildSource.makePhoenix(PrintStreamMessenger.err);
                 ^
TestSerial.java:97: ??????????
?????? ???? PrintStreamMessenger
?????? ?? TestSerial
       phoenix = BuildSource.makePhoenix(source, PrintStreamMessenger.err);
                                                 ^
TestSerial.java:97: ??????????
?????? ???? BuildSource
?????? ?? TestSerial
       phoenix = BuildSource.makePhoenix(source, PrintStreamMessenger.err);
                 ^
TestSerial.java:100: ??????????
?????? ?? MoteIF
?????? ?? TestSerial
     MoteIF mif = new MoteIF(phoenix);
     ^
TestSerial.java:100: ??????????
?????? ?? MoteIF
?????? ?? TestSerial
     MoteIF mif = new MoteIF(phoenix);
                      ^
TestSerialMsg.java:18: ??????????
?????? ???? amTypeSet(int)
?????? ?? TestSerialMsg
         amTypeSet(AM_TYPE);
         ^
TestSerialMsg.java:24: ??????????
?????? ???? amTypeSet(int)
?????? ?? TestSerialMsg
         amTypeSet(AM_TYPE);
         ^
TestSerialMsg.java:33: ??????????
?????? ???? amTypeSet(int)
?????? ?? TestSerialMsg
         amTypeSet(AM_TYPE);
         ^
TestSerialMsg.java:42: ??????????
?????? ???? amTypeSet(int)
?????? ?? TestSerialMsg
         amTypeSet(AM_TYPE);
         ^
TestSerialMsg.java:51: ??????????
?????? ???? amTypeSet(int)
?????? ?? TestSerialMsg
         amTypeSet(AM_TYPE);
         ^
TestSerialMsg.java:60: ??????????
?????? ???? amTypeSet(int)
?????? ?? TestSerialMsg
         amTypeSet(AM_TYPE);
         ^
TestSerialMsg.java:69: ??????????
?????? ???? amTypeSet(int)
?????? ?? TestSerialMsg
         amTypeSet(AM_TYPE);
         ^
TestSerialMsg.java:78: ??????????
?????? ???? amTypeSet(int)
?????? ?? TestSerialMsg
         amTypeSet(AM_TYPE);
         ^
TestSerialMsg.java:134: ??????????
?????? ???? getUIntBEElement(int,int)
?????? ?? TestSerialMsg
         return (int)getUIntBEElement(offsetBits_counter(), 16);
                     ^
TestSerialMsg.java:134: ??????????????
?????? getUIntBEElement
?????? int
         return (int)getUIntBEElement(offsetBits_counter(), 16);
                                     ^
TestSerialMsg.java:141: ??????????
?????? ???? setUIntBEElement(int,int,int)
?????? ?? TestSerialMsg
         setUIntBEElement(offsetBits_counter(), 16, value);
         ^
28 ????
make: *** [TestSerial.class] Error 1*
*
*I hope that you can tell me how I can solute these questions!*
*Thank you for your**appreciation!*
*
*with regards
hongliping.*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*

At 2010-12-09 15:11:20??"Urs Hunkeler"<urs.hunke...@epfl.ch>  wrote:

>Hi,
>
>This means that the TinyOS Java libraries are not found. Maybe the
>classpath is not set correctly, or the libraries are not compiled.
>Usually, the libraries are in $TOSROOT/support/sdk/java/ or
>$TOSROOT/support/sdk/java/tinyos.jar (you can use either).
>
>What is the output of the command "echo $CLASSPATH"?
>Which operating system are you using?
>How did you install TinyOS?
>
>Cheers,
>Urs
>
>On 12/09/2010 03:38 AM, hongliping7123 wrote:
>>  TestSerial.java:35: package net.tinyos.message does not exist
>>  import net.tinyos.message.*;
>>  ^
>>  TestSerial.java:39: cannot find symbol
>>  symbol: class MessageListener
>>  public class TestSerial implements MessageListener {
>>  ^
>>  TestSerial.java:41: cannot find symbol
>>  symbol : class MoteIF
>>  location: class TestSerial
>>  private MoteIF moteIF;
>>  ^
>>  TestSerial.java:43: cannot find symbol
>>  symbol : class MoteIF
>>  location: class TestSerial
>>  public TestSerial(MoteIF moteIF) {
>>  ^
>>  TestSerial.java:68: cannot find symbol
>>  symbol : class Message
>>  location: class TestSerial
>>  public void messageReceived(int to, Message message) {
>>  ^
>>  TestSerialMsg.java:7: package net.tinyos.message does not exist
>>  public class TestSerialMsg extends net.tinyos.message.Message {
>>  ^
>>  TestSerialMsg.java:67: package net.tinyos.message does not exist
>>  public TestSerialMsg(net.tinyos.message.Message msg, int base_offset) {
>>  ^
>>  TestSerialMsg.java:76: package net.tinyos.message does not exist
>>  public TestSerialMsg(net.tinyos.message.Message msg, int base_offset, int da
>>  ta_length) {
>>  ^
>>  TestSerial.java:100: cannot find symbol
>>  symbol : class MoteIF
>>  location: class TestSerial
>>  MoteIF mif = new MoteIF(phoenix);
>>  ^
>>  TestSerial.java:100: cannot find symbol
>>  symbol : class MoteIF
>>  location: class TestSerial
>>  MoteIF mif = new MoteIF(phoenix);
>>  ^
>>  TestSerialMsg.java:18: cannot find symbol
>>  symbol : method amTypeSet(int)
>>  location: class TestSerialMsg
>>  amTypeSet(AM_TYPE);
>>  ^
>>  TestSerialMsg.java:24: cannot find symbol
>>  symbol : method amTypeSet(int)
>>  location: class TestSerialMsg
>>  amTypeSet(AM_TYPE);
>>  ^
>>  TestSerialMsg.java:33: cannot find symbol
>>  symbol : method amTypeSet(int)
>>  location: class TestSerialMsg
>>  amTypeSet(AM_TYPE);
>>  ^
>>  TestSerialMsg.java:42: cannot find symbol
>>  symbol : method amTypeSet(int)
>>  location: class TestSerialMsg
>>  amTypeSet(AM_TYPE);
>>  ^
>>  TestSerialMsg.java:51: cannot find symbol
>>  symbol : method amTypeSet(int)
>>  location: class TestSerialMsg
>>  amTypeSet(AM_TYPE);
>>  ^
>>  TestSerialMsg.java:60: cannot find symbol
>>  symbol : method amTypeSet(int)
>>  location: class TestSerialMsg
>>  amTypeSet(AM_TYPE);
>>  ^
>>  TestSerialMsg.java:69: cannot find symbol
>>  symbol : method amTypeSet(int)
>>  location: class TestSerialMsg
>>  amTypeSet(AM_TYPE);
>>  ^
>>  TestSerialMsg.java:78: cannot find symbol
>>  symbol : method amTypeSet(int)
>>  location: class TestSerialMsg
>>  amTypeSet(AM_TYPE);
>>  ^
>>  TestSerialMsg.java:134: cannot find symbol
>>  symbol : method getUIntBEElement(int,int)
>>  location: class TestSerialMsg
>>  return (int)getUIntBEElement(offsetBits_counter(), 16);
>>  ^
>>  TestSerialMsg.java:134: inconvertible types
>>  found : getUIntBEElement
>>  required: int
>>  return (int)getUIntBEElement(offsetBits_counter(), 16);
>>  ^
>>  TestSerialMsg.java:141: cannot find symbol
>>  symbol : method setUIntBEElement(int,int,int)
>>  location: class TestSerialMsg
>>  setUIntBEElement(offsetBits_counter(), 16, value);
>>  ^
>>  21 errors
>>  make: *** [TestSerial.class] Error 1
>>  I thought it may be the problem with java configuration,so I tried to
>>  properly configure the java installation, but still the same error message.
>>  I will appreciate for any suggestion regarding this.
>>  Thank you.
>>  with regards
>>  hongliping.


?? ??163/126??????????????iphone ipad???????? <http://help.163.com/special/007525G0/163mail_guide.html?id=2716>

_______________________________________________
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to