Dear All, Help on Call yarp from Matlab.

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

Dear All, Help on Call yarp from Matlab.

zhenli
Dear All.
    Thanks the help from Juan.
    Under the installation step, I try to call yarp from
matlab. It shows the following information:
    >> LoadYarp
??? Java exception occurred:
java.lang.NoClassDefFoundError: yarp/Network

        at LoadYarp.<init>(LoadYarp.java:21)
Then I check from LoadYarp.java:21, it is the function:
   Network.init();
The steps for me are shown as following:
  1. Download YARP from SVN.
  2. Install yarp
  3. Install JDK jdk1.5.0_22,also set the environment
variable for JDK
  4.download Swig  swigwin-2.0.4
  5. compile the swig folder
  6. Copy *.java from src to generated_src
  7. do javac -source 1.3 -target 1.3 *.java
  8. modify classpath.txt,librarypath.txt, add the two
line at the end of them
C:\work\yarp2\example\swig\generated_src
C:\work\yarp2\example\swig\Release
   9. open matlab, input LoadYarp from its command window,
Then I got the error information:
??? Java exception occurred:
java.lang.NoClassDefFoundError: yarp/Network

I guess that java not work within YARP Framework. Who can
tell me how to solve this problem.
  I test it in windows XP (64,32bit) and matlab r2007b, I
got the same situation.I also try different swig and java,
things are the same.
Best regards.
Zhenli

------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
Robotcub-hackers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/robotcub-hackers
Reply | Threaded
Open this post in threaded view
|

Re: Dear All, Help on Call yarp from Matlab.

leo_pape
This post was updated on .
Hi Zhenli,

The error you get means that Matlab cannot find the class <yarp/Network> relative to its Java path. You should set the Java classpath in Matlab to a location that contains a directory <yarp>, which in turn contains the classes generated by Swig -> Java (such as <Network.class>). Alternatively, you could put everything in a <yarp> directory in a <jar> file, and add it to Matlab's Java classpath. The Matlab command for this is <javaaddpath>.

Note that not every method in YARP works in Java, because Java does not have multiple inheritance. I occasionally implement missing Java functionality, but there is no guarantee this makes it into new releases.

http://robotcub-hackers.2198711.n2.nabble.com/Programatic-version-of-yarp-name-list-td2570480.html#a6496967

--Leo