Petre,
I have successfully build simpleclient.jar. Then I try to run it.
1. Setup library path with command #1
export LD_LIBRARY_PATH=$(pwd)/out/linux/x86_64/debug/:$LD_LIBRARY_PATH
echo $LD_LIBRARAY_PATH shows /home/me/iotivity/out/linux/x86_64/debug folder
path, I suppose it is correct
2. Run java -cp
java/examples-java/simpleclient/build/libs/simpleclient.jar:java/iotivity-linux/build/libs/iotivity-linux.jar
org.iotivity.base.examples.SimpleClient
It gives me this error
Exception in thread "main" java.lang.UnsatisfiedLinkError: no ocstack-jni in
java.library.path
at java.lang.System.loadLibrary(System.java:1122)
at org.iotivity.base.OcPlatform.<clinit>(OcPlatform.java:42)
at
org.iotivity.base.examples.SimpleClient.startSimpleClient(SimpleClient.java:75)
at org.iotivity.base.examples.SimpleClient.main(SimpleClient.java:518)
There is an ocstack.o and ocstack.so, but Java is looking for ocstack-jni.
Does my build generate files with incorrect suffix?
P.S.
I solved the scons problem by adding [Defaults env_keep += "JAVA_HOME"]
to /etc/sudoers.
Because I am running ./auto_build with sudo. But sudo reset those env.
I?ve try to run ./auto_build without sudo, it will gives me boost_thread error,
don?t know what that means.
From: iotivity-dev-bounces at lists.iotivity.org
[mailto:[email protected]] On Behalf Of Maxi Wu
Sent: Friday, June 17, 2016 11:14 AM
To: 'Eftime, Petre P'; dev at mobileink.com
Cc: iotivity-dev at lists.iotivity.org
Subject: Re: [dev] Is it possible to port the Java(Android) API to general java
application?
Hi Petre,
I have iotivity-linux.jar, which is good. But simpleclient and simpleserver are
missing. /java/examples-java/simpleclient folder only have /src and gradle
script, same with simpleserver.
I have checked that my gradle 2.14 is installed and added to $PATH.
I try to run gradle build under /java/examples-java folder, it gives an error
message ?unknown property TARGET_OS?. This property is defined in SCONS. I
don?t know how to add it to gradle.
I am reading ./auto_build.sh linux_unsecured_with_java output and will try to
figure out what went wrong.
Do you have a way to build java examples project without using SCONS?
From: Eftime, Petre P [mailto:[email protected]]
Sent: Thursday, June 16, 2016 4:44 PM
To: dev at mobileink.com; maxi.wu at u-media.com.tw
Cc: iotivity-dev at lists.iotivity.org; uzchoi at samsung.com
Subject: Re: [dev] Is it possible to port the Java(Android) API to general java
application?
Hi Maxi,
Yes, that file should exist if the library finished building correctly. Do you
have JAVA_HOME set? Right now it only throws a warning message and does not
compile the Java bindings if it's not set. I'll make it stop the compile with
an error if BUILD_JAVA is ON and it's not set.
--
Petre Eftime
On Thu, 2016-06-16 at 15:12 +0800, maxi wu wrote:
Hi Petre,
After I run these two commands at iotivity root folder, it gives me
Error: Could not find or load main class org.iotivity.base.examples.SimpleClient
I looked into folder /java/iotivity-linux/, there is only /src, don?t have a
/build folder, so there is no iotivity-linux.jar
I compile with ./auto_build.sh linux_unsecured_with_java
Am I supposed to get the iotivity-linux.jar after running this command?
From: Eftime, Petre P [mailto:[email protected]]
Sent: Tuesday, May 31, 2016 3:50 PM
To: Gregg Reynolds
Cc: iotivity-dev at lists.iotivity.org; uzchoi at samsung.com; maxi.wu at
u-media.com.tw
Subject: RE: [dev] Is it possible to port the Java(Android) API to general java
application?
Hi Gregg,
I found the cause of the issue and updated the change.
This patch fixes the issue:
https://gerrit.iotivity.org/gerrit/#/c/7895/6..7/build_common/linux/SConscript
--
Petre Eftime
From: Gregg Reynolds [mailto:[email protected]]
Sent: Monday, May 30, 2016 7:04 PM
To: Eftime, Petre P <petre.p.eftime at intel.com>
Cc: iotivity-dev at lists.iotivity.org; uzchoi at samsung.com; maxi.wu at
u-media.com.tw
Subject: Re: [dev] Is it possible to port the Java(Android) API to general java
application?
On Wed, May 4, 2016 at 3:58 AM, Eftime, Petre P <petre.p.eftime at intel.com>
wrote:
Hi,
My changes already include a working SimpleClient/SimpleServer working with
Java Bindings, you should be able to compile them by running
./auto_build.sh linux_unsecured_with_java
on the latest patch in the change. To run the simpleclient you will need to run
these commands in the root iotivity folder, assuming you have not changed the
output folder:
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
What I could use help with is removing the dependency on Android from the other
examples in java/examples-java.
Hi Petre,
If you still need help with this I have some time. The problem is I can't get
the compile to work (see my other messages). I started by checking out the
source from gerrit, then I checked out the generic-java branch, but it does not
include your changes in https://gerrit.iotivity.org/gerrit/#/c/7895/ . So I
poked around and figured out how to get the change from Gerrit. At least I
think I did, I ended up with your changes. But ./auto_build.sh
linux_unsecured_with_java gives me
AttributeError: 'SConsEnvironment' object has no attribute 'Download':
...
File "/home/gar/iotivity/iotivity/extlibs/android/gradle/SConscript", line 22:
gradle_zip = env.Download('gradle2.2.1.zip',
'https://services.gradle.org/distributions/gradle-2.2.1-all.zip')
If you (or anybody) could offer detailed instructions for building the
generic-java version (for somebody unfamiliar with gerrit) I can get started on
examples-java.
Thanks,
Gregg
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20160617/70064dcd/attachment.html>