#first export JAVA_HOME so the java build can find Java. Use path that makes 
since on your system.
$ export JAVA_HOME=/usr/lib/jvm/java-1.8.0/
#build code using SCons of the auto_build script
$ scons BUILD_JAVA=1
#or
$ auto_build.py build_linux_secured_with_java

Now run the samples.
# Change to the output directories.
$cd out/linux/x86_64/release/java
# run the samples
$ java -Djava.library.path=.. -jar simplerserver.jar
$ java -Djava.library.path=.. -jar simpleclient.jar

If the samples crash instantly saying they cannot find a library check your 
java.library.path make sure it is pointing to the directory that contains the 
libocstack-jni.so file.

Hope this helps.

George

From: iotivity-dev-boun...@lists.iotivity.org 
[mailto:iotivity-dev-boun...@lists.iotivity.org] On Behalf Of == ? ==
Sent: Sunday, October 1, 2017 11:48 AM
To: Mats Wichmann <m...@wichmann.us>; 孙立峰 <snowwolf...@163.com>; iotivity-dev 
<iotivity-dev@lists.iotivity.org>
Subject: [dev] 回复: 回复: About using Java language

[cid:image001.png@01D348D0.B9B5E760]
where is build.sh


------------------ 原始邮件 ------------------
发件人: "Mats Wichmann"<m...@wichmann.us<mailto:m...@wichmann.us>>;
发送时间: 2017年10月2日(星期一) 凌晨2:40
收件人: "== 卫 == "<liuwe...@qq.com<mailto:liuwe...@qq.com>>; 
"孙立峰"<snowwolf...@163.com<mailto:snowwolf...@163.com>>; 
"iotivity-dev"<iotivity-dev@lists.iotivity.org<mailto:iotivity-dev@lists.iotivity.org>>;
主题: Re: 回复: [dev] About using Java language

On 10/01/2017 12:32 PM, ==  卫 ==   wrote:
> Hi Max:
>     Are there released jar files。
>     Build is very complicated。

Right now, the project only releases "source code".  1.3.1 is in final
preparation, and it will also be a tarball, and a git tag.

The Java-themed build isn't actually very complicated to /run/ (it may
be complicated to understand all of what's happening, but that's a
different story).  If you've never built it before, you need to get the
host system dependencies installed, which is a one-time job and
documented on the wiki, and the first build will stop a couple of times
for you to check out from git trees of external projects because
developers felt it wasn't safe to automatically check those out; all the
other dependencies are automatically downloaded. but besides that
one-time cost, the build is no more complicated on a Linux host than:

1. make sure JAVA_HOME is set

2.

./build.sh build_linux_secured_with_java

or

./build.sh build_linux_unsecured_with_java

depending on which one you want.

_______________________________________________
iotivity-dev mailing list
iotivity-dev@lists.iotivity.org
https://lists.iotivity.org/mailman/listinfo/iotivity-dev

Reply via email to