Please send messages to the help list...

I believe the default behavior is to put the class file in the
same directory as the source. You can use the "-d path" option
to specify an different destination.

So just to review, since I remember spending years figuring it out.
You can think of the java package name as an extension of the file
system structure but it's a little tricky when to use dots and slashes:

source file in:           .../tinyos/tools/net/tinyos/tools/plot.java
shell current directory:  .../tinyos/tools
CLASSPATH includes: "."
compile command:          javac net/tinyos/tools/plot.java
execute command:          java  net.tinyos.tools.plot

You may need other packages and directories in your CLASSPATH, but the
"." current directory should cover all the tinyos/tools files.

MS

andy fox wrote:
> I put the plot.java file in the same director as Listen.java which is 
> /opt/tinyos-2.1.1/support/sdk/java/net/tinyos/tools.  This doesn't work 
> because I don't know where the Listen.class file is located so I'm just 
> sure where to put the plot.class file.
> 
> On Wed, Oct 20, 2010 at 4:18 PM, Michael Schippling <[email protected] 
> <mailto:[email protected]>> wrote:
> 
>     You should probably read a bit about Java and it's ideas of program
>     structure before you really frustrate yourself...
> 
>     But to answer your question:
>     Basically package names and directory structures should be congruent.
>     Put your file in the same directory as "Listen.java" if you want to
>     run it with the package name you gave.
> 
>     I'm not sure how the TOS makefile works in the tools trees -- it may
>     make everything -- but you can usually compile any program and it's
>     dependencies with: javac full/path/to/main/file.java
> 
>     MS
> 
>     andy fox wrote:
> 
>         I want to use the Listen file to read in input from a telosb
>         mote but instead of just displaying the packet in hex, I would
>         like to use the packet info to do something else.
>         Just to test though I am just trying to get a file with the name
>         plot.java to run.  It has the exact same code as Listen.java
>         does but I'm not sure where to put it.
>         I would like to run this program by using a command like java
>         net.tinyos.tools.plot.
>         Any help would be appreciated.
> 
> 
> 
>         
> ------------------------------------------------------------------------
> 
>         _______________________________________________
>         Tinyos-help mailing list
>         [email protected]
>         <mailto:[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

Reply via email to