On Wed, Jun 15, 2016 at 6:46 AM, Eftime, Petre P <petre.p.eftime at intel.com>
wrote:

> Hi Gregg,
>
> That doesn't seem to be a JNI error, but a classpath error. To include the
> JNI layer you'll just have to set the LD_LIBRARY_PATH and the corresponding
> libraries should be loaded automatically.
> After build is done you should have a set of jar files and a set of .so
> files. The jar files are found in the java folder, and the .so files will
> be found in the output folder.
>
> These are the commands I use on Linux, from the main IoTivity folder, but
> it should be similar for Darwin, with some path modications:
>
> export LD_LIBRARY_PATH=$(pwd)/out/linux/x86_64/debug/:$LD_LIBRARY_PATH
>
> java -cp
> java/examples-java/simpleclient/build/libs/simpleclient.jar:java/iotivity-linux/build/libs/iotivity-linux.jar
> org.iotivity.base.examples.SimpleClient
>
> From an IDE you should be able to just import the two jar files and set
> the LD_LIBRARY_PATH environment variable.
>
> There is no official way to package the .so files in JAR files, although
> there is a library which does this. Android went around this limitation by
> creating their own .aar format, which is also supported by some other
> tools, such as Maven.
>

Yay!  It runs!  Then it stops. :(

Server:

+ java -cp
./java/examples-java/simpleserver/build/libs/simpleserver.jar:./java/iotivity-darwin/build/libs/iotivity-darwin.jar
-Djava.library.path=/Users/gar/iotivity/iotivation/libiotivity/out/darwin/x86_64/release/
org.iotivity.base.examples.SimpleServer
[O]SimpleServer | Configuring platform.
[O]SimpleServer | Creating a light
[O]SimpleServer | URI: /a/light
name: John's light
state: false
power: 0
[O]SimpleServer | Registering light as a resource
[O]SimpleServer | Waiting for the requests...
[O]SimpleServer |
------------------------------------------------------------------------
~/iotivity/iotivation/libiotivity
$

Client:

 java -cp
./java/examples-java/simpleclient/build/libs/simpleclient.jar:./java/iotivity-darwin/build/libs/iotivity-darwin.jar
-Djava.library.path=/Users/gar/iotivity/iotivation/libiotivity/out/darwin/x86_64/release/
org.iotivity.base.examples.SimpleClient
[O]SimpleClient | Configuring platform.
[O]SimpleClient | Finding all resources of type "core.light".
[O]SimpleClient | Finding all resources of type "core.light" for the second
time
[O]SimpleClient |
------------------------------------------------------------------------
( waiting...)

Is this a case of the Java example ports needing more work?  Or is there
something more going on.

Thanks,

Gregg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20160615/9dc8210e/attachment.html>

Reply via email to