Hi Ahmad, I think your java does not find the tinyos.jar file. This seems like an installation problem, check that your CLASSPATH is properly set up. Most likely your java is a windows application (not the openjdk from cygwin), so your CLASSPATH should contain a windows style path to the tinyos.jar. You can also try to specify the jar manually as a command line argument to java.
Best, Miklos On Sun, Dec 2, 2012 at 10:06 PM, Ahmad Muhaimin <[email protected]> wrote: > Hi András, > > I try to compile the tinyos.jar file because I got problem with the > execution of "java net.tinyos.tools.Listen" in cygwin shell. It gives the > following error. > > $ java net.tinyos.tools.Listen > Exception in thread "main" java.lang.NoClassDefFoundError: > net/tinyos/packet/ByteSource > at net.tinyos.tools.Listen.main(Listen.java:53) > Caused by: java.lang.ClassNotFoundException: net.tinyos.packet.ByteSource > at java.net.URLClassLoader$1.run(Unknown Source) > 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) > ... 1 more > > Then I read guidelines in this website, > http://www.geoffreylo.com/resources/tinyos-primer/ , step 2. It said that > tinyos.jar need to be recompiled if I have problem with the tinyosWiki > tutorial. > > I have append the CLASSPATH environment variable according to the website. > > export CLASSPATH=".;C:/cygwin/opt/tinyos-2.x/support/sdk/java" > export > CLASSPATH="$CLASSPATH;C:\cygwin\opt\tinyos-2.x\support\sdk\java\tinyos.jar;." > > > > > On Mon, Dec 3, 2012 at 5:11 AM, András Bíró <[email protected]> wrote: >> >> Hi Ahmad, >> >> Why would you like to compile tinyos.jar? Tinyos comes with a precompiled >> one at $TOSROOT/support/sdk/java/tinyos.jar >> >> Andras Biro >> Software Engineer >> Unicomp Ltd. >> http://ucmote.com >> >> >> >> >> On Sun, Dec 2, 2012 at 2:46 AM, Ahmad Muhaimin <[email protected]> >> wrote: >>> >>> >>> >>> When I try to compile TinyOS.jar file in >>> /opt/tinyos-2.x/support/sdk/java, I got the following error, I have try a >>> fresh install of Cygwin and TinyOS, still no luck. >>> >>> PrintfMsg.java:90: error: unclosed string literal >>> s += " [nx_struct printf_msg 28 100 >>> ^ >>> PrintfMsg.java:91: error: illegal start of expression >>> =0x"+Long.toHexString(get_nx_struct printf_msg 28 100 >>> ^ >>> PrintfMsg.java:91: error: hexadecimal numbers must contain at least one >>> hexadecimal digit >>> =0x"+Long.toHexString(get_nx_struct printf_msg 28 100 >>> ^ >>> PrintfMsg.java:91: error: unclosed string literal >>> =0x"+Long.toHexString(get_nx_struct printf_msg 28 100 >>> ^ >>> PrintfMsg.java:91: error: ';' expected >>> =0x"+Long.toHexString(get_nx_struct printf_msg 28 100 >>> ^ >>> PrintfMsg.java:92: error: illegal start of expression >>> ())+"]\n"; >>> ^ >>> PrintfMsg.java:92: error: ';' expected >>> ())+"]\n"; >>> ^ >>> PrintfMsg.java:92: error: not a statement >>> ())+"]\n"; >>> ^ >>> PrintfMsg.java:111: error: ';' expected >>> public static boolean isSigned_nx_struct printf_msg 28 100 >>> ^ >>> PrintfMsg.java:111: error: <identifier> expected >>> public static boolean isSigned_nx_struct printf_msg 28 100 >>> ^ >>> PrintfMsg.java:111: error: illegal start of type >>> public static boolean isSigned_nx_struct printf_msg 28 100 >>> ^ >>> PrintfMsg.java:111: error: <identifier> expected >>> public static boolean isSigned_nx_struct printf_msg 28 100 >>> ^ >>> PrintfMsg.java:112: error: ';' expected >>> () { >>> ^ >>> PrintfMsg.java:120: error: ';' expected >>> public static boolean isArray_nx_struct printf_msg 28 100 >>> ^ >>> PrintfMsg.java:120: error: <identifier> expected >>> public static boolean isArray_nx_struct printf_msg 28 100 >>> ^ >>> PrintfMsg.java:120: error: illegal start of type >>> public static boolean isArray_nx_struct printf_msg 28 100 >>> ^ >>> PrintfMsg.java:120: error: <identifier> expected >>> public static boolean isArray_nx_struct printf_msg 28 100 >>> ^ >>> PrintfMsg.java:121: error: ';' expected >>> () { >>> >>> I also cannot execute "java net.tinyos.tools.Listen", it gives the >>> following error. >>> >>> $ java net.tinyos.tools.Listen >>> Exception in thread "main" java.lang.NoClassDefFoundError: >>> net/tinyos/packet/ByteSource >>> at net.tinyos.tools.Listen.main(Listen.java:53) >>> Caused by: java.lang.ClassNotFoundException: net.tinyos.packet.ByteSource >>> at java.net.URLClassLoader$1.run(Unknown Source) >>> 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) >>> ... 1 more >>> >>> >>> >>> _______________________________________________ >>> Tinyos-help mailing list >>> [email protected] >>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help >> >> > > > > -- > Ahmad Muhaimin bin Mohd Taib > Student of Bachelor(Hons) Electrical and Electronic Engineering, > Universiti Teknologi Petronas, > Bandar Seri Iskandar, > 31750 Tronoh, > Perak Darul Ridzuan. > > > _______________________________________________ > Tinyos-help mailing list > [email protected] > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
