This is what I was referring to:
>       
> Re: JNI Questions
> by Michael Schippling-2 Apr 07, 2010; 11:25am 
> 
> okokok, I use the old snuffly javacomm20 for windows not TOSComm,
> but here's what I have in my JRE:
> 
>      jre/bin:
>         getenv.dll  win32com.dll
>      jre/lib:
>         javax.comm.properties
>        jre/lib/ext:
>           comm.jar
> 
> I don't know if TOSComm's uses the old comm.jar or something else,
> nor what it's dll file name might be, but you probably need a
> simulacra of each of the files shown.
> 
> MS
 >

First you install a Java Development Kit.

Then you either go through all the TOS install procedures,
or just copy the files I listed above into the JRE in that
JavaDevKit directory. Once you have something that works
under cygwin or the Linux shell, you use the same JDK/JRE
with Eclipse (and include the tos jar file in your build).

I think Eclipse will use the JDK that is in your PATH variable.
If on Windoze you can set that through the
     ComputerManager->SystemProperties panel,
although installing a JDK should do that for you.
There are also settings panels in Eclipse to select Java
versions and JREs if you need to work with different ones.

Aside from the specific libraries needed for GetEnv and
Serial Comm this has nothing to do with TOS, it's all
about getting your JRE setup correctly. One could ask
why Sun thought it NOT a good idea to include GetEnv
(they apparently removed it from System early on) or
any access to I/O ports (who uses I/O these days?) in
their Magical New Universal Programming Environment,
but it would be pointless...

MS


syxu wrote:
> Hi Michael,
>  
> Thank you for your quick reply.
>  
> I checked the archive and found Ruben Rios del Pozo 's problem is very 
> similiar to mine. But I don't understand how it is fixed. I am very new 
> to TinyOS and Java. Can you explain it in more details?
>  
> In  Ruben Rios del Pozo's solution, he said "Finally I got it to work 
> with the toscomm.dll and getenv.dll library from TinyOS by just linking 
> the tinyos.jar with these libraries in Eclipse." How to get these dlls? 
> (Copy from TOS?) How to link tinyos.jar with these libraries? (Add these 
> libraries in my project in Eclipse?) What to do with tinyos.jar in my 
> project?
>  
> In your solution, you said "You will need to install (or copy) the TOS 
> comm and getenv.dll files to your new system's Java Runtime.". How to 
> install them in my JRE?
>  
> Thanks a lot.
>  
> Regards,
> Songyan
> 
> 
>  
> On Thu, May 20, 2010 at 4:13 PM, Michael Schippling <[email protected] 
> <mailto:[email protected]>> wrote:
> 
>     Search back on this list for the last few weeks for my, other's,
>     posts about what needs to be setup in your Java Runtime Env in
>     order to execute any Java program that connects to a TOS basestation.
> 
>     I run TOS-to-Java programs under Eclipse all the time. Once you have
>     your JRE setup right, "all you need to do" is add the TOS jar file
>     to your build path and set the MOTECOM envvar in the Run Configurations
>     panel for your program.
> 
>     MS
> 
>     syxu wrote:
> 
>         Spam detection software, running on the system
>         "mail.Millennium.Berkeley.EDU
>         <http://mail.millennium.berkeley.edu/>", has
>         identified this incoming email as possible spam.  The original
>         message
>         has been attached to this so you can view it (if it isn't spam)
>         or label
>         similar future email.  If you have any questions, see
>         the administrator of that system for details.
> 
>         Content preview:  Hi all, My problem is about using Eclipse to
>         develope a TinyOS
> 
>           project. In Eclipse, I write a GUI using Java. It calls an ILP
>         solver, Sat4j,
>           to create an output. Using this output, I send commands to
>         sensor network.
>           [...]
>         Content analysis details:   (4.3 points, 3.3 required)
> 
>          pts rule name              description
>         ---- ----------------------
>         --------------------------------------------------
>          3.2 FH_DATE_PAST_20XX      The date is grossly in the future.
>          0.0 HTML_MESSAGE           BODY: HTML included in message
>          0.0 BAYES_50               BODY: Bayesian spam probability is
>         40 to 60%
>                                    [score: 0.4300]
>          1.1 DNS_FROM_OPENWHOIS     RBL: Envelope sender listed in
>         bl.open-whois.org <http://bl.open-whois.org/>.
>         -0.0 AWL                    AWL: From: address is in the auto
>         white-list
> 
>         The original message was not completely plain text, and may be
>         unsafe to
>         open with some email clients; in particular, it may contain a virus,
>         or confirm that your address can receive spam.  If you wish to view
>         it, it may be safer to save it to a file and open it with an editor.
> 
> 
> 
>         
> ------------------------------------------------------------------------
> 
>         Subject:
>         Fwd: a problem with tinyos and eclipse
>         From:
>         syxu <[email protected] <mailto:[email protected]>>
>         Date:
>         Thu, 20 May 2010 12:01:47 -0500
>         To:
>         [email protected]
>         <mailto:[email protected]>
> 
>         To:
>         [email protected]
>         <mailto:[email protected]>
> 
> 
> 
>         Hi all,
>          My problem is about using Eclipse to develope a TinyOS project.
>          In Eclipse, I write a GUI using Java. It calls an ILP solver,
>         Sat4j, to create an output.
>         Using this output, I send commands to sensor network.
>          So how to connect Java GUI with the code written using TinyOS
>         package in Eclipse?
>         Currently I add tinyos.jar into GUI's build path in Eclipse and
>         copy the ~Msg.java (created
>         using Mig in TinyOS) to my GUI project. But the grammar is ok.
>         But when I run the project,
>         it reports "getEnv JNI not found" and the project can not execute.
>          How to fix this problem?
>          And if this does not work, I have to move GUI to TinyOS and
>         compile it in TinyOS. Then when I
>         run it, calling sat4j (ILP solver written in Java) reports
>         execption. Can I call a program installed outside
>         of TinyOS?
>          Thanks a lot.
> 
> 
>         
> ------------------------------------------------------------------------
> 
>         _______________________________________________
>         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