Hello, I'm having an issue testing the java remote API on linux, specifically Debian Wheezy on a raspberry pi. When trying to run simpleTest.java I receive the error
"UnsatisfiedLinkError: no remoteApiJava in java.library.path"
I have ensured the files in \V-REP_PRO_EDU_V3_0_4_Linux\programming\remoteApiSharedLib\ are in the path(s) specified by the java -XshowSettings:properties command.
I have also placed it other locations and used the -Djava.library.path= switch to point to the new path. Everytime I get the same error.
pi@raspberrypi ~/Java/VREP $ sudo /opt/jdk1.8.0/bin/java -Djava.library.path=/lib -jar VREP.jar
Program started
Exception in thread "main" java.lang.UnsatisfiedLinkError: no remoteApiJava in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1886)
at java.lang.Runtime.loadLibrary0(Runtime.java:845)
at java.lang.System.loadLibrary(System.java:1085)
at coppelia.remoteApi.<clinit>(remoteApi.java:31)
at simpleTest.main(simpleTest.java:28)
can you have a look at this post (second part only) and check if this works for you? (the first part of the post was still during V-REP V3.0.3, so you shouldn't be downloading the fixed source)
I renamed remoteApiJava.so to libremoteApiJava.so which seemed to solve the original problem. But now I have error indicating it can't run on Arm architecture. This is on a Raspberry Pi using Java 1.8
pi@raspberrypi ~ $ sudo /opt/jdk1.8.0/bin/java -jar Java/VREP/VREP.jar Program started
Exception in thread "main" java.lang.UnsatisfiedLinkError: /lib/libremoteApiJava.so: /lib/libremoteApiJava.so: cannot open shared object file: No such file or directory (Possible cause: can't load IA 32-bit .so on a ARM-bit platform)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1954)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1876)
at java.lang.Runtime.loadLibrary0(Runtime.java:845)
at java.lang.System.loadLibrary(System.java:1085)
at coppelia.remoteApi.<clinit>(remoteApi.java:31)
at simpleTest.main(simpleTest.java:28)
Any help would be appreciated. There does seem to be ways to fix the issue however I am not familiar with C/C++, and not quite sure of the difficulty.
This should build remoteApiJava.so. On linux, do not forget to rename it to libremoteApiJava.so, since Java's system.loadLibrary will automatically append a "lib" to the filename.
I can now run simpleTest.java . I'm hoping now you or anyone can help me with my new problem :) I cannot connect to the V-rep server from a Raspberry Pi. I have ensured the server is running since I can connect to it from the same windows machine and simpleTest runs, I can see the output showing the amount of objects as well as the connection on the V-REP console.
On the Pi it times out everytime. I have disabled firewall on both the Pi and the Windows machine running V-REP. I've ran a Wireshark scan against the Pi and it never is actually sending any data during the simpleTest run. I can get on a webbrowser on the Pi and browse out to the V-REP server on the same port 19999 and can see the traffic on Wireshark so I know the connection can be made. It seems like the application isn't able to use the Pi's ethernet adapter. I've tried wired and wireless, different ports, building the .so with JDK 1.7 and other various things but I can't get anywhere.
It seems that the remote API client cannot send out data. Could you add some debugging printfs in the functions:
extApi_connectToServer_socket
extApi_send_socket
extApi_recv_socket
which are located in file extApiPlatform.c Those are the only platform specific communication functions in the remote API client. You will of course have to rebuild the shared library.