Help on LoadYarp from Java and Matlab

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Help on LoadYarp from Java and Matlab

zhenli
Dear All,
   I really feel a bit confuss, why I can not call
LoadYarp from MAtlab.
  My steps are shown as following:
1. install YARP2.
2. download and unzip swigwin1.3.31
3.download JDK 6 and install it,add its jdk/bin to
enviroment variable path.
4. run camke to set the swig directory.
5.After generation, I call project.sln
6. build a release version for the project
7. check the generated_src, the *.java is here, and copy
src/*.java to generated_src
8.Open a cmd window and change to generated_src directory.
Do javac -source 1.3 -target 1.3 *.java  No problem
9.Add C:\work\yarp2\example\swig\generated_src
       C:\work\yarp2\example\swig\Release
   to classpath.txt and librarypath.txt   no problem
10 run matlab, when I input LoadYarp
I got the following information:

>> LoadYarp
??? Java exception occurred:
java.lang.NoClassDefFoundError: yarp/Network

        at LoadYarp.<init>(LoadYarp.java:21)

Then I open a CMD window and change to
C:\work\yarp2\example\swig\generated_src
and input java -classpath . LoadYarp
I got the following information
Error,can not find the main function for class
LoadYarp,please define the main function as:
public static void main(String[] args)

Then I try to call Example1.java from the CMD window

I use "java -classpath . Example1"
I got the following information
Exception in thread "main" java.lang.NoClassDefFoundError:
yarp/Network at Example1.main(Example1.java:16)
Caused by: java.lang.ClassNotFoundExeption:yarp.Network
  at java.net.URLClassLoader$1.run(Unknow Source)
  at
java.net.security.AccessController.doPrivileged(Native
Methods)............

since we only use matlab to call LoadYarp. Thus I believe
I make some mistake in Java. So please help me solve this
problem.
   Best regards.
   Zhenli

------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts.
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Robotcub-hackers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/robotcub-hackers
Reply | Threaded
Open this post in threaded view
|

Re: Help on LoadYarp from Java and Matlab

zhenli
Dear Juan.
   Thanks for your help.
   I think it is some problem between java and yarp. I
also testify it under ubuntu 10.0.4, I got the following
information:
    zhenli@ubuntu:~/work/yarp2/example/swig/generated_src$
java Example1
#
# A fatal error has been detected by the Java Runtime
Environment:
#
#  SIGSEGV (0xb) at pc=0x002d94b0, pid=3147,
tid=3077978992
#
# JRE version: 6.0_20-b20
# Java VM: OpenJDK Server VM (19.0-b09 mixed mode
linux-x86 )
# Derivative: IcedTea6 1.9.9
# Distribution: Ubuntu 10.04.1 LTS, package
6b20-1.9.9-0ubuntu1~10.04.2
# Problematic frame:
# C  [libjyarp.so+0x3e4b0]
 Java_yarp_yarpJNI_Contactable_1open_1_1SWIG_11+0x40
#
# An error report file with more information is saved as:
#
/home/zhenli/work/yarp2/example/swig/generated_src/hs_err_pid3147.log
#
# If you would like to submit a bug report, please include
# instructions how to reproduce the bug and visit:
#   https://bugs.launchpad.net/ubuntu/+source/openjdk-6/
# The crash happened outside the Java Virtual Machine in
native code.
# See problematic frame for where to report the bug.
#
Aborted

I really follow the step shown on the website about java
and yarp.
I will try on my 64 bit computer to see what is happened.
Thanks again.
Best regards.
Zhenli
Em Tue, 9 Aug 2011 12:18:23 +0200
  Juan G Victores <[hidden email]> escreveu:

> Ps: I mean libYARP_OS etc
> On Aug 8, 2011 6:08 PM, "Zhenli Lu" <[hidden email]>
>wrote:
>> dear juan.
>> Thank you very much for your email.
>> Yes, I really put "PREPARE_CLASS_FILES" on. The
>> different is that now I got *.java and *.class in
>> swig\yarp directory. And the generate_src is empty.
>> Then I copy *.java from src directory to swig\yarp
>> directory.
>> Then I open a cmd window, input javac -source 1.3
>> -target 1.3 *.java
>> Next I add the two line
>> C:\work\yarp2\example\swig\yarp
>> C:\work\yarp2\example\swig\Release
>> to classpath.txt and librarypath.txt no problem
>> next I run matlab, when I input LoadYarp
>> I got the following information:
>> LoadYarp
>> ??? Java exception occurred:
>> java.lang.UnsatisfiedLinkError:
>> C:\work\yarp2\example\swig\yarp\jyarp.dll: Can't find
>> dependent
>> libraries
>>
>> at java.lang.ClassLoader$NativeLibrary.load(Native
>> Method)
>>
>> at java.lang.ClassLoader.loadLibrary0(Unknown Source)
>>
>> at java.lang.ClassLoader.loadLibrary(Unknown Source)
>>
>> at java.lang.Runtime.loadLibrary0(Unknown Source)
>>
>> at java.lang.System.loadLibrary(Unknown Source)
>>
>> at LoadYarp.<init>(LoadYarp.java:20)
>>
>> And I check that the jyarp.lib is in the Release
>> directory.
>> I really a bit confuse about this problem.
>> I use jdk 1.7.0, SVN download YARP and swig 1.3.1 or
>> swig 2.4. matlab R2007b.
>> Okay, I will check the installation on ubuntu.But I
>> prefer to run on windows.
>> Thanks again.
>> Best regards.
>> Zhenli
>>
>> Em Mon, 8 Aug 2011 08:04:43 +0200
>> Juan G Victores <[hidden email]> escreveu:
>>> Hi Zhenli,
>>> I'm pretty sure it's something related to
>>>absolute/relative paths as it's
>>> what has happened to me in the past. Today I have good
>>>internet but I'm on a
>>> Linux machine so I still can't replicate your problem.
>>>However, I have
>>> checked the specific CMake parameter that helped me:
>>>it's called
>>> "PREPARE_CLASS_FILES". It appears when you set
>>>CREATE_JAVA. Setting it ON
>>> not only calls javac, it also seems to set the paths
>>>correctly.
>>>
>>> Hope this helps!
>>> juan.
>>>
>>> 2011/8/4 Zhenli Lu <[hidden email]>
>>>
>>>> Dear Juan.
>>>> Thank you very much for your email.
>>>> I think java is activated on my computer. Since when I
>>>>open a CMD window,
>>>> I input java or javac, they all work fine. Besides, I
>>>>try to compile and run
>>>> the HelloWorld.java on my computer, that is works.
>>>> Then I run cmake for yaro and swig.
>>>>
>>>> I am sorry, I run it under windows XP, where can I get
>>>>the "compile
>>>> classes" in the cmake options?
>>>> When I use cmake for the directory
>>>>"C:\work\yarp2\example\swig".
>>>> I set the swig and jdk by myself.
>>>> things like these:
>>>>
>>>> SWIG_DIR: C:/work/swigwin-1.3.31/Lib
>>>> SWIG_EXECUTABLE: C:/work/swigwin-1.3.31/swig.**exe
>>>> SWIG_VERSION: 1.3.31
>>>>
>>>> JAVA_AWT_INCLUDE_PATH: C:/Program
>>>>Files/Java/jdk1.5.0_22/include
>>>> JAVA_AWT_LIBRARY: C:/Program
>>>>Files/Java/jdk1.5.0_22/lib/**jawt.lib
>>>> JAVA_INCLUDE_PATH: C:/Program
>>>>Files/Java/jdk1.5.0_22/include
>>>> JAVA_INCLUDE_PATH2: C:/Program
>>>>Files/Java/jdk1.5.0_22/**include/win32
>>>> JAVA_JVM_LIBRARY: C:/Program
>>>>Files/Java/jdk1.5.0_22/lib/**jvm.lib
>>>> PREPAIR_CLASS_FILES:OFF
>>>>
>>>>
>>>> The version of Cmake is 2.6. I really try different
>>>>version of cmake
>>>> and swig,java. My Yarp2 is downloaded from SVN. I also
>>>>try matlab 2007b and
>>>> 2009a. Things are the same.
>>>> So I can not find more ways to find out what is
>>>>wrong for Call yarp
>>>> from Java or matlab.
>>>> Best regards.
>>>> Zhenli
>>>> Em Thu, 4 Aug 2011 12:11:21 +0200
>>>>
>>>> Juan G Victores <[hidden email]> escreveu:
>>>>
>>>>> Ps. Cmake of yarp swig. Seen when java activated.
>>>>>
>>>>> On Aug 4, 2011 12:55 AM, "Zhenli Lu" <[hidden email]>
>>>>>wrote:
>>>>>
>>>>>> Dear All,
>>>>>> I really feel a bit confuss, why I can not call
>>>>>> LoadYarp from MAtlab.
>>>>>> My steps are shown as following:
>>>>>> 1. install YARP2.
>>>>>> 2. download and unzip swigwin1.3.31
>>>>>> 3.download JDK 6 and install it,add its jdk/bin to
>>>>>> enviroment variable path.
>>>>>> 4. run camke to set the swig directory.
>>>>>> 5.After generation, I call project.sln
>>>>>> 6. build a release version for the project
>>>>>> 7. check the generated_src, the *.java is here, and copy
>>>>>> src/*.java to generated_src
>>>>>> 8.Open a cmd window and change to generated_src
>>>>>>directory.
>>>>>> Do javac -source 1.3 -target 1.3 *.java No problem
>>>>>> 9.Add C:\work\yarp2\example\swig\**generated_src
>>>>>> C:\work\yarp2\example\swig\**Release
>>>>>> to classpath.txt and librarypath.txt no problem
>>>>>> 10 run matlab, when I input LoadYarp
>>>>>> I got the following information:
>>>>>>
>>>>>> LoadYarp
>>>>>>>>
>>>>>>> ??? Java exception occurred:
>>>>>> java.lang.**NoClassDefFoundError: yarp/Network
>>>>>>
>>>>>> at LoadYarp.<init>(LoadYarp.java:**21)
>>>>>>
>>>>>> Then I open a CMD window and change to
>>>>>> C:\work\yarp2\example\swig\**generated_src
>>>>>> and input java -classpath . LoadYarp
>>>>>> I got the following information
>>>>>> Error,can not find the main function for class
>>>>>> LoadYarp,please define the main function as:
>>>>>> public static void main(String[] args)
>>>>>>
>>>>>> Then I try to call Example1.java from the CMD window
>>>>>>
>>>>>> I use "java -classpath . Example1"
>>>>>> I got the following information
>>>>>> Exception in thread "main"
>>>>>>java.lang.**NoClassDefFoundError:
>>>>>> yarp/Network at Example1.main(Example1.java:**16)
>>>>>> Caused by:
>>>>>>java.lang.**ClassNotFoundExeption:yarp.**Network
>>>>>> at java.net.URLClassLoader$1.run(**Unknow Source)
>>>>>> at
>>>>>> java.net.security.**AccessController.doPrivileged(**Native
>>>>>> Methods)............
>>>>>>
>>>>>> since we only use matlab to call LoadYarp. Thus I
>>>>>>believe
>>>>>> I make some mistake in Java. So please help me solve
>>>>>>this
>>>>>> problem.
>>>>>> Best regards.
>>>>>> Zhenli
>>>>>>
>>>>>>
>>>>>> ------------------------------**------------------------------**
>>>>> ------------------
>>>>>
>>>>>> BlackBerry&reg; DevCon Americas, Oct. 18-20, San
>>>>>>Francisco, CA
>>>>>> The must-attend event for mobile developers. Connect
>>>>>>with experts.
>>>>>> Get tools for creating Super Apps. See the latest
>>>>>>technologies.
>>>>>> Sessions, hands-on labs, demos & much more. Register
>>>>>>early & save!
>>>>>> http://p.sf.net/sfu/rim-**blackberry-1<
> http://p.sf.net/sfu/rim-blackberry-1>
>>>>>> ______________________________**_________________
>>>>>> Robotcub-hackers mailing list
>>>>>> Robotcub-hackers@lists.**sourceforge.net<
> [hidden email]>
>>>>>> https://lists.sourceforge.net/**lists/listinfo/robotcub-**hackers<
> https://lists.sourceforge.net/lists/listinfo/robotcub-hackers>
>>>>>>
>>>>>
>>>> Zhenli LU PHD
>>>> IEETA-Instituto de Engenharia Electrónica e Telemática
>>>>de Aveiro
>>>> Campus Universitário de Santiago
>>>> Universidade de Aveiro
>>>> 3810-193 Aveiro
>>>> Portugal
>>>> Telf. 351 234 370 531
>>>> (internal number: 24131)
>>>> Fax 351 234 370 545
>>>>
>>>
>>>
>>>
>>>
>>> --
>>>
>>> ________________________________________________________
>>> http://roboticslab.uc3m.es/roboticslab/persona_publ.php?id_pers=72
>>> PhD Candidate - RoboticsLab Researcher
>>> Dpto. de Ingeniería de Sistemas y Automática
>>> Universidad Carlos III de Madrid
>>


 

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at:  http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Robotcub-hackers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/robotcub-hackers
Reply | Threaded
Open this post in threaded view
|

Re: Help on LoadYarp from Java and Matlab

Stéphane Lallée
Zhen Li,

I didn't use java & yarp for a while but this:
>> java.lang.UnsatisfiedLinkError: C:\work\yarp2\example\swig\yarp\jyarp.dll: Can't find dependent libraries

probably means that jyarp.dll is not in the path (I'm not sure if matlab has a special path or if it is using windows path).

Hope it can help...

Bye !

Stéphane



2011/8/9 Zhenli Lu <[hidden email]>
Dear Juan.
  Thanks for your help.
  I think it is some problem between java and yarp. I
also testify it under ubuntu 10.0.4, I got the following
information:
   zhenli@ubuntu:~/work/yarp2/example/swig/generated_src$
java Example1
#
# A fatal error has been detected by the Java Runtime
Environment:
#
#  SIGSEGV (0xb) at pc=0x002d94b0, pid=3147,
tid=<a href="tel:3077978992" value="+13077978992">3077978992
#
# JRE version: 6.0_20-b20
# Java VM: OpenJDK Server VM (19.0-b09 mixed mode
linux-x86 )
# Derivative: IcedTea6 1.9.9
# Distribution: Ubuntu 10.04.1 LTS, package
6b20-1.9.9-0ubuntu1~10.04.2
# Problematic frame:
# C  [libjyarp.so+0x3e4b0]
 Java_yarp_yarpJNI_Contactable_1open_1_1SWIG_11+0x40
#
# An error report file with more information is saved as:
#
/home/zhenli/work/yarp2/example/swig/generated_src/hs_err_pid3147.log
#
# If you would like to submit a bug report, please include
# instructions how to reproduce the bug and visit:
#   https://bugs.launchpad.net/ubuntu/+source/openjdk-6/
# The crash happened outside the Java Virtual Machine in
native code.
# See problematic frame for where to report the bug.
#
Aborted

I really follow the step shown on the website about java
and yarp.
I will try on my 64 bit computer to see what is happened.
Thanks again.
Best regards.
Zhenli
Em Tue, 9 Aug 2011 12:18:23 +0200
 Juan G Victores <[hidden email]> escreveu:
> Ps: I mean libYARP_OS etc
> On Aug 8, 2011 6:08 PM, "Zhenli Lu" <[hidden email]>
>wrote:
>> dear juan.
>> Thank you very much for your email.
>> Yes, I really put "PREPARE_CLASS_FILES" on. The
>> different is that now I got *.java and *.class in
>> swig\yarp directory. And the generate_src is empty.
>> Then I copy *.java from src directory to swig\yarp
>> directory.
>> Then I open a cmd window, input javac -source 1.3
>> -target 1.3 *.java
>> Next I add the two line
>> C:\work\yarp2\example\swig\yarp
>> C:\work\yarp2\example\swig\Release
>> to classpath.txt and librarypath.txt no problem
>> next I run matlab, when I input LoadYarp
>> I got the following information:
>> LoadYarp
>> ??? Java exception occurred:
>> java.lang.UnsatisfiedLinkError:
>> C:\work\yarp2\example\swig\yarp\jyarp.dll: Can't find
>> dependent
>> libraries
>>
>> at java.lang.ClassLoader$NativeLibrary.load(Native
>> Method)
>>
>> at java.lang.ClassLoader.loadLibrary0(Unknown Source)
>>
>> at java.lang.ClassLoader.loadLibrary(Unknown Source)
>>
>> at java.lang.Runtime.loadLibrary0(Unknown Source)
>>
>> at java.lang.System.loadLibrary(Unknown Source)
>>
>> at LoadYarp.<init>(LoadYarp.java:20)
>>
>> And I check that the jyarp.lib is in the Release
>> directory.
>> I really a bit confuse about this problem.
>> I use jdk 1.7.0, SVN download YARP and swig 1.3.1 or
>> swig 2.4. matlab R2007b.
>> Okay, I will check the installation on ubuntu.But I
>> prefer to run on windows.
>> Thanks again.
>> Best regards.
>> Zhenli
>>
>> Em Mon, 8 Aug 2011 08:04:43 +0200
>> Juan G Victores <[hidden email]> escreveu:
>>> Hi Zhenli,
>>> I'm pretty sure it's something related to
>>>absolute/relative paths as it's
>>> what has happened to me in the past. Today I have good
>>>internet but I'm on a
>>> Linux machine so I still can't replicate your problem.
>>>However, I have
>>> checked the specific CMake parameter that helped me:
>>>it's called
>>> "PREPARE_CLASS_FILES". It appears when you set
>>>CREATE_JAVA. Setting it ON
>>> not only calls javac, it also seems to set the paths
>>>correctly.
>>>
>>> Hope this helps!
>>> juan.
>>>
>>> 2011/8/4 Zhenli Lu <[hidden email]>
>>>
>>>> Dear Juan.
>>>> Thank you very much for your email.
>>>> I think java is activated on my computer. Since when I
>>>>open a CMD window,
>>>> I input java or javac, they all work fine. Besides, I
>>>>try to compile and run
>>>> the HelloWorld.java on my computer, that is works.
>>>> Then I run cmake for yaro and swig.
>>>>
>>>> I am sorry, I run it under windows XP, where can I get
>>>>the "compile
>>>> classes" in the cmake options?
>>>> When I use cmake for the directory
>>>>"C:\work\yarp2\example\swig".
>>>> I set the swig and jdk by myself.
>>>> things like these:
>>>>
>>>> SWIG_DIR: C:/work/swigwin-1.3.31/Lib
>>>> SWIG_EXECUTABLE: C:/work/swigwin-1.3.31/swig.**exe
>>>> SWIG_VERSION: 1.3.31
>>>>
>>>> JAVA_AWT_INCLUDE_PATH: C:/Program
>>>>Files/Java/jdk1.5.0_22/include
>>>> JAVA_AWT_LIBRARY: C:/Program
>>>>Files/Java/jdk1.5.0_22/lib/**jawt.lib
>>>> JAVA_INCLUDE_PATH: C:/Program
>>>>Files/Java/jdk1.5.0_22/include
>>>> JAVA_INCLUDE_PATH2: C:/Program
>>>>Files/Java/jdk1.5.0_22/**include/win32
>>>> JAVA_JVM_LIBRARY: C:/Program
>>>>Files/Java/jdk1.5.0_22/lib/**jvm.lib
>>>> PREPAIR_CLASS_FILES:OFF
>>>>
>>>>
>>>> The version of Cmake is 2.6. I really try different
>>>>version of cmake
>>>> and swig,java. My Yarp2 is downloaded from SVN. I also
>>>>try matlab 2007b and
>>>> 2009a. Things are the same.
>>>> So I can not find more ways to find out what is
>>>>wrong for Call yarp
>>>> from Java or matlab.
>>>> Best regards.
>>>> Zhenli
>>>> Em Thu, 4 Aug 2011 12:11:21 +0200
>>>>
>>>> Juan G Victores <[hidden email]> escreveu:
>>>>
>>>>> Ps. Cmake of yarp swig. Seen when java activated.
>>>>>
>>>>> On Aug 4, 2011 12:55 AM, "Zhenli Lu" <[hidden email]>
>>>>>wrote:
>>>>>
>>>>>> Dear All,
>>>>>> I really feel a bit confuss, why I can not call
>>>>>> LoadYarp from MAtlab.
>>>>>> My steps are shown as following:
>>>>>> 1. install YARP2.
>>>>>> 2. download and unzip swigwin1.3.31
>>>>>> 3.download JDK 6 and install it,add its jdk/bin to
>>>>>> enviroment variable path.
>>>>>> 4. run camke to set the swig directory.
>>>>>> 5.After generation, I call project.sln
>>>>>> 6. build a release version for the project
>>>>>> 7. check the generated_src, the *.java is here, and copy
>>>>>> src/*.java to generated_src
>>>>>> 8.Open a cmd window and change to generated_src
>>>>>>directory.
>>>>>> Do javac -source 1.3 -target 1.3 *.java No problem
>>>>>> 9.Add C:\work\yarp2\example\swig\**generated_src
>>>>>> C:\work\yarp2\example\swig\**Release
>>>>>> to classpath.txt and librarypath.txt no problem
>>>>>> 10 run matlab, when I input LoadYarp
>>>>>> I got the following information:
>>>>>>
>>>>>> LoadYarp
>>>>>>>>
>>>>>>> ??? Java exception occurred:
>>>>>> java.lang.**NoClassDefFoundError: yarp/Network
>>>>>>
>>>>>> at LoadYarp.<init>(LoadYarp.java:**21)
>>>>>>
>>>>>> Then I open a CMD window and change to
>>>>>> C:\work\yarp2\example\swig\**generated_src
>>>>>> and input java -classpath . LoadYarp
>>>>>> I got the following information
>>>>>> Error,can not find the main function for class
>>>>>> LoadYarp,please define the main function as:
>>>>>> public static void main(String[] args)
>>>>>>
>>>>>> Then I try to call Example1.java from the CMD window
>>>>>>
>>>>>> I use "java -classpath . Example1"
>>>>>> I got the following information
>>>>>> Exception in thread "main"
>>>>>>java.lang.**NoClassDefFoundError:
>>>>>> yarp/Network at Example1.main(Example1.java:**16)
>>>>>> Caused by:
>>>>>>java.lang.**ClassNotFoundExeption:yarp.**Network
>>>>>> at java.net.URLClassLoader$1.run(**Unknow Source)
>>>>>> at
>>>>>> java.net.security.**AccessController.doPrivileged(**Native
>>>>>> Methods)............
>>>>>>
>>>>>> since we only use matlab to call LoadYarp. Thus I
>>>>>>believe
>>>>>> I make some mistake in Java. So please help me solve
>>>>>>this
>>>>>> problem.
>>>>>> Best regards.
>>>>>> Zhenli
>>>>>>
>>>>>>
>>>>>> ------------------------------**------------------------------**
>>>>> ------------------
>>>>>
>>>>>> BlackBerry&reg; DevCon Americas, Oct. 18-20, San
>>>>>>Francisco, CA
>>>>>> The must-attend event for mobile developers. Connect
>>>>>>with experts.
>>>>>> Get tools for creating Super Apps. See the latest
>>>>>>technologies.
>>>>>> Sessions, hands-on labs, demos & much more. Register
>>>>>>early & save!
>>>>>> http://p.sf.net/sfu/rim-**blackberry-1<
> http://p.sf.net/sfu/rim-blackberry-1>
>>>>>> ______________________________**_________________
>>>>>> Robotcub-hackers mailing list
>>>>>> Robotcub-hackers@lists.**sourceforge.net<
> [hidden email]>
>>>>>> https://lists.sourceforge.net/**lists/listinfo/robotcub-**hackers<
> https://lists.sourceforge.net/lists/listinfo/robotcub-hackers>
>>>>>>
>>>>>
>>>> Zhenli LU PHD
>>>> IEETA-Instituto de Engenharia Electrónica e Telemática
>>>>de Aveiro
>>>> Campus Universitário de Santiago
>>>> Universidade de Aveiro
>>>> 3810-193 Aveiro
>>>> Portugal
>>>> Telf. 351 234 370 531
>>>> (internal number: 24131)
>>>> Fax 351 234 370 545
>>>>
>>>
>>>
>>>
>>>
>>> --
>>>
>>> ________________________________________________________
>>> http://roboticslab.uc3m.es/roboticslab/persona_publ.php?id_pers=72
>>> PhD Candidate - RoboticsLab Researcher
>>> Dpto. de Ingeniería de Sistemas y Automática
>>> Universidad Carlos III de Madrid
>>




------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at:  http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Robotcub-hackers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/robotcub-hackers


------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at:  http://p.sf.net/sfu/wandisco-dev2dev

_______________________________________________
Robotcub-hackers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/robotcub-hackers
Reply | Threaded
Open this post in threaded view
|

Re: Help on LoadYarp from Java and Matlab

zhenli
Dear Stephane.
   Nice to hear your feedback.
   I will try it more details.
    Cheers.
   Zhenli
Em Tue, 9 Aug 2011 17:09:10 +0200
  Stéphane Lallée <[hidden email]> escreveu:

> Zhen Li,
>
> I didn't use java & yarp for a while but this:
>
>> >> java.lang.UnsatisfiedLinkError:
>> C:\work\yarp2\example\swig\yarp\jyarp.dll: Can't find
>>dependent libraries
>
>
> probably means that jyarp.dll is not in the path (I'm
>not sure if matlab has
> a special path or if it is using windows path).
>
> Hope it can help...
>
> Bye !
>
> Stéphane
>
>
>
> 2011/8/9 Zhenli Lu <[hidden email]>
>
>> Dear Juan.
>>   Thanks for your help.
>>   I think it is some problem between java and yarp. I
>> also testify it under ubuntu 10.0.4, I got the following
>> information:
>>    zhenli@ubuntu:~/work/yarp2/example/swig/generated_src$
>> java Example1
>> #
>> # A fatal error has been detected by the Java Runtime
>> Environment:
>> #
>> #  SIGSEGV (0xb) at pc=0x002d94b0, pid=3147,
>> tid=3077978992
>> #
>> # JRE version: 6.0_20-b20
>> # Java VM: OpenJDK Server VM (19.0-b09 mixed mode
>> linux-x86 )
>> # Derivative: IcedTea6 1.9.9
>> # Distribution: Ubuntu 10.04.1 LTS, package
>> 6b20-1.9.9-0ubuntu1~10.04.2
>> # Problematic frame:
>> # C  [libjyarp.so+0x3e4b0]
>>  Java_yarp_yarpJNI_Contactable_1open_1_1SWIG_11+0x40
>> #
>> # An error report file with more information is saved
>>as:
>> #
>> /home/zhenli/work/yarp2/example/swig/generated_src/hs_err_pid3147.log
>> #
>> # If you would like to submit a bug report, please
>>include
>> # instructions how to reproduce the bug and visit:
>> #   https://bugs.launchpad.net/ubuntu/+source/openjdk-6/
>> # The crash happened outside the Java Virtual Machine in
>> native code.
>> # See problematic frame for where to report the bug.
>> #
>> Aborted
>>
>> I really follow the step shown on the website about java
>> and yarp.
>> I will try on my 64 bit computer to see what is
>>happened.
>> Thanks again.
>> Best regards.
>> Zhenli
>> Em Tue, 9 Aug 2011 12:18:23 +0200
>>  Juan G Victores <[hidden email]> escreveu:
>> > Ps: I mean libYARP_OS etc
>> > On Aug 8, 2011 6:08 PM, "Zhenli Lu" <[hidden email]>
>> >wrote:
>> >> dear juan.
>> >> Thank you very much for your email.
>> >> Yes, I really put "PREPARE_CLASS_FILES" on. The
>> >> different is that now I got *.java and *.class in
>> >> swig\yarp directory. And the generate_src is empty.
>> >> Then I copy *.java from src directory to swig\yarp
>> >> directory.
>> >> Then I open a cmd window, input javac -source 1.3
>> >> -target 1.3 *.java
>> >> Next I add the two line
>> >> C:\work\yarp2\example\swig\yarp
>> >> C:\work\yarp2\example\swig\Release
>> >> to classpath.txt and librarypath.txt no problem
>> >> next I run matlab, when I input LoadYarp
>> >> I got the following information:
>> >> LoadYarp
>> >> ??? Java exception occurred:
>> >> java.lang.UnsatisfiedLinkError:
>> >> C:\work\yarp2\example\swig\yarp\jyarp.dll: Can't find
>> >> dependent
>> >> libraries
>> >>
>> >> at java.lang.ClassLoader$NativeLibrary.load(Native
>> >> Method)
>> >>
>> >> at java.lang.ClassLoader.loadLibrary0(Unknown Source)
>> >>
>> >> at java.lang.ClassLoader.loadLibrary(Unknown Source)
>> >>
>> >> at java.lang.Runtime.loadLibrary0(Unknown Source)
>> >>
>> >> at java.lang.System.loadLibrary(Unknown Source)
>> >>
>> >> at LoadYarp.<init>(LoadYarp.java:20)
>> >>
>> >> And I check that the jyarp.lib is in the Release
>> >> directory.
>> >> I really a bit confuse about this problem.
>> >> I use jdk 1.7.0, SVN download YARP and swig 1.3.1 or
>> >> swig 2.4. matlab R2007b.
>> >> Okay, I will check the installation on ubuntu.But I
>> >> prefer to run on windows.
>> >> Thanks again.
>> >> Best regards.
>> >> Zhenli
>> >>
>> >> Em Mon, 8 Aug 2011 08:04:43 +0200
>> >> Juan G Victores <[hidden email]> escreveu:
>> >>> Hi Zhenli,
>> >>> I'm pretty sure it's something related to
>> >>>absolute/relative paths as it's
>> >>> what has happened to me in the past. Today I have
>>good
>> >>>internet but I'm on a
>> >>> Linux machine so I still can't replicate your
>>problem.
>> >>>However, I have
>> >>> checked the specific CMake parameter that helped me:
>> >>>it's called
>> >>> "PREPARE_CLASS_FILES". It appears when you set
>> >>>CREATE_JAVA. Setting it ON
>> >>> not only calls javac, it also seems to set the paths
>> >>>correctly.
>> >>>
>> >>> Hope this helps!
>> >>> juan.
>> >>>
>> >>> 2011/8/4 Zhenli Lu <[hidden email]>
>> >>>
>> >>>> Dear Juan.
>> >>>> Thank you very much for your email.
>> >>>> I think java is activated on my computer. Since
>>when I
>> >>>>open a CMD window,
>> >>>> I input java or javac, they all work fine. Besides,
>>I
>> >>>>try to compile and run
>> >>>> the HelloWorld.java on my computer, that is works.
>> >>>> Then I run cmake for yaro and swig.
>> >>>>
>> >>>> I am sorry, I run it under windows XP, where can I
>>get
>> >>>>the "compile
>> >>>> classes" in the cmake options?
>> >>>> When I use cmake for the directory
>> >>>>"C:\work\yarp2\example\swig".
>> >>>> I set the swig and jdk by myself.
>> >>>> things like these:
>> >>>>
>> >>>> SWIG_DIR: C:/work/swigwin-1.3.31/Lib
>> >>>> SWIG_EXECUTABLE: C:/work/swigwin-1.3.31/swig.**exe
>> >>>> SWIG_VERSION: 1.3.31
>> >>>>
>> >>>> JAVA_AWT_INCLUDE_PATH: C:/Program
>> >>>>Files/Java/jdk1.5.0_22/include
>> >>>> JAVA_AWT_LIBRARY: C:/Program
>> >>>>Files/Java/jdk1.5.0_22/lib/**jawt.lib
>> >>>> JAVA_INCLUDE_PATH: C:/Program
>> >>>>Files/Java/jdk1.5.0_22/include
>> >>>> JAVA_INCLUDE_PATH2: C:/Program
>> >>>>Files/Java/jdk1.5.0_22/**include/win32
>> >>>> JAVA_JVM_LIBRARY: C:/Program
>> >>>>Files/Java/jdk1.5.0_22/lib/**jvm.lib
>> >>>> PREPAIR_CLASS_FILES:OFF
>> >>>>
>> >>>>
>> >>>> The version of Cmake is 2.6. I really try different
>> >>>>version of cmake
>> >>>> and swig,java. My Yarp2 is downloaded from SVN. I
>>also
>> >>>>try matlab 2007b and
>> >>>> 2009a. Things are the same.
>> >>>> So I can not find more ways to find out what is
>> >>>>wrong for Call yarp
>> >>>> from Java or matlab.
>> >>>> Best regards.
>> >>>> Zhenli
>> >>>> Em Thu, 4 Aug 2011 12:11:21 +0200
>> >>>>
>> >>>> Juan G Victores <[hidden email]> escreveu:
>> >>>>
>> >>>>> Ps. Cmake of yarp swig. Seen when java activated.
>> >>>>>
>> >>>>> On Aug 4, 2011 12:55 AM, "Zhenli Lu"
>><[hidden email]>
>> >>>>>wrote:
>> >>>>>
>> >>>>>> Dear All,
>> >>>>>> I really feel a bit confuss, why I can not call
>> >>>>>> LoadYarp from MAtlab.
>> >>>>>> My steps are shown as following:
>> >>>>>> 1. install YARP2.
>> >>>>>> 2. download and unzip swigwin1.3.31
>> >>>>>> 3.download JDK 6 and install it,add its jdk/bin
>>to
>> >>>>>> enviroment variable path.
>> >>>>>> 4. run camke to set the swig directory.
>> >>>>>> 5.After generation, I call project.sln
>> >>>>>> 6. build a release version for the project
>> >>>>>> 7. check the generated_src, the *.java is here,
>>and copy
>> >>>>>> src/*.java to generated_src
>> >>>>>> 8.Open a cmd window and change to generated_src
>> >>>>>>directory.
>> >>>>>> Do javac -source 1.3 -target 1.3 *.java No
>>problem
>> >>>>>> 9.Add C:\work\yarp2\example\swig\**generated_src
>> >>>>>> C:\work\yarp2\example\swig\**Release
>> >>>>>> to classpath.txt and librarypath.txt no problem
>> >>>>>> 10 run matlab, when I input LoadYarp
>> >>>>>> I got the following information:
>> >>>>>>
>> >>>>>> LoadYarp
>> >>>>>>>>
>> >>>>>>> ??? Java exception occurred:
>> >>>>>> java.lang.**NoClassDefFoundError: yarp/Network
>> >>>>>>
>> >>>>>> at LoadYarp.<init>(LoadYarp.java:**21)
>> >>>>>>
>> >>>>>> Then I open a CMD window and change to
>> >>>>>> C:\work\yarp2\example\swig\**generated_src
>> >>>>>> and input java -classpath . LoadYarp
>> >>>>>> I got the following information
>> >>>>>> Error,can not find the main function for class
>> >>>>>> LoadYarp,please define the main function as:
>> >>>>>> public static void main(String[] args)
>> >>>>>>
>> >>>>>> Then I try to call Example1.java from the CMD
>>window
>> >>>>>>
>> >>>>>> I use "java -classpath . Example1"
>> >>>>>> I got the following information
>> >>>>>> Exception in thread "main"
>> >>>>>>java.lang.**NoClassDefFoundError:
>> >>>>>> yarp/Network at Example1.main(Example1.java:**16)
>> >>>>>> Caused by:
>> >>>>>>java.lang.**ClassNotFoundExeption:yarp.**Network
>> >>>>>> at java.net.URLClassLoader$1.run(**Unknow Source)
>> >>>>>> at
>> >>>>>>
>>java.net.security.**AccessController.doPrivileged(**Native
>> >>>>>> Methods)............
>> >>>>>>
>> >>>>>> since we only use matlab to call LoadYarp. Thus I
>> >>>>>>believe
>> >>>>>> I make some mistake in Java. So please help me
>>solve
>> >>>>>>this
>> >>>>>> problem.
>> >>>>>> Best regards.
>> >>>>>> Zhenli
>> >>>>>>
>> >>>>>>
>> >>>>>>
>>------------------------------**------------------------------**
>> >>>>> ------------------
>> >>>>>
>> >>>>>> BlackBerry&reg; DevCon Americas, Oct. 18-20, San
>> >>>>>>Francisco, CA
>> >>>>>> The must-attend event for mobile developers.
>>Connect
>> >>>>>>with experts.
>> >>>>>> Get tools for creating Super Apps. See the latest
>> >>>>>>technologies.
>> >>>>>> Sessions, hands-on labs, demos & much more.
>>Register
>> >>>>>>early & save!
>> >>>>>> http://p.sf.net/sfu/rim-**blackberry-1<
>> > http://p.sf.net/sfu/rim-blackberry-1>
>> >>>>>> ______________________________**_________________
>> >>>>>> Robotcub-hackers mailing list
>> >>>>>> Robotcub-hackers@lists.**sourceforge.net<
>> > [hidden email]>
>> >>>>>>
>>https://lists.sourceforge.net/**lists/listinfo/robotcub-**hackers<
>> >
>>https://lists.sourceforge.net/lists/listinfo/robotcub-hackers>
>> >>>>>>
>> >>>>>
>> >>>> Zhenli LU PHD
>> >>>> IEETA-Instituto de Engenharia Electrónica e
>>Telemática
>> >>>>de Aveiro
>> >>>> Campus Universitário de Santiago
>> >>>> Universidade de Aveiro
>> >>>> 3810-193 Aveiro
>> >>>> Portugal
>> >>>> Telf. 351 234 370 531
>> >>>> (internal number: 24131)
>> >>>> Fax 351 234 370 545
>> >>>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>>
>> >>>
>>________________________________________________________
>> >>>
>>http://roboticslab.uc3m.es/roboticslab/persona_publ.php?id_pers=72
>> >>> PhD Candidate - RoboticsLab Researcher
>> >>> Dpto. de Ingeniería de Sistemas y Automática
>> >>> Universidad Carlos III de Madrid
>> >>
>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> uberSVN's rich system and user administration
>>capabilities and model
>> configuration take the hassle out of deploying and
>>managing Subversion and
>> the tools developers use with it. Learn more about
>>uberSVN and get a free
>> download at:  http://p.sf.net/sfu/wandisco-dev2dev
>> _______________________________________________
>> Robotcub-hackers mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/robotcub-hackers
>>

Zhenli LU  PHD
IEETA-Instituto de Engenharia Electrónica e Telemática de
Aveiro
Campus Universitário de Santiago
Universidade de Aveiro
3810-193 Aveiro
Portugal
Telf. 351 234 370 531
(internal number: 24131)
Fax 351 234 370 545
 

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at:  http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Robotcub-hackers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/robotcub-hackers