Getting Matlab OpenSim interface to work
- Sarah Wohlman
- Posts: 7
- Joined: Fri Feb 25, 2011 1:37 pm
Getting Matlab OpenSim interface to work
I followed the instructions from: http://simtk-confluence.stanford.edu:80 ... anualSetup
but when I run one of the example scripts, I get a Java error.
Java exception occurred:
java.lang.NoClassDefFoundError: Could not initialize class org.opensim.modeling.opensimModelJNI
at org.opensim.modeling.Model.<init>(Model.java:127)
Any suggestions on how to fix this?
Thanks!
but when I run one of the example scripts, I get a Java error.
Java exception occurred:
java.lang.NoClassDefFoundError: Could not initialize class org.opensim.modeling.opensimModelJNI
at org.opensim.modeling.Model.<init>(Model.java:127)
Any suggestions on how to fix this?
Thanks!
Re: Getting Matlab OpenSim interface to work
Hi Sarah,
Did you use the automated matlab setup script (configureOpenSim.m)?
Does an error occur when you run any openSim API code or just the one example script?
Did you use the automated matlab setup script (configureOpenSim.m)?
Does an error occur when you run any openSim API code or just the one example script?
- Sarah Wohlman
- Posts: 7
- Joined: Fri Feb 25, 2011 1:37 pm
Re: Getting Matlab OpenSim interface to work
I was previously using 3.1 so that is why I didn't use the automated setup script. But when I tried the automated setup script with 3.2, it worked.
I'm able to run most of the example scripts except for TugOfWar_CompleteRunVisualize.m, I'm still getting an error with the visualizer.
I'm able to run most of the example scripts except for TugOfWar_CompleteRunVisualize.m, I'm still getting an error with the visualizer.
- Vrutangkumar Shah
- Posts: 3
- Joined: Mon Feb 06, 2017 4:55 pm
Re: Getting Matlab OpenSim interface to work
Hello,
I am also getting the same error. I have used the automated script and I also got the pop up message that it configured successfully. Now, when I tried to run any of the examples scripts, it showing me following error:
Error using TugOfWar_CompleteRunVisualize (line 32)
Java exception occurred:
java.lang.NoClassDefFoundError: Could not initialize class org.opensim.modeling.opensimModelJNI
at org.opensim.modeling.Model.<init>(Model.java:127)
I have also attached snap shot of the matlab command window for reference.
Any help is highly appreciated!
Thanks.
I am also getting the same error. I have used the automated script and I also got the pop up message that it configured successfully. Now, when I tried to run any of the examples scripts, it showing me following error:
Error using TugOfWar_CompleteRunVisualize (line 32)
Java exception occurred:
java.lang.NoClassDefFoundError: Could not initialize class org.opensim.modeling.opensimModelJNI
at org.opensim.modeling.Model.<init>(Model.java:127)
I have also attached snap shot of the matlab command window for reference.
Any help is highly appreciated!
Thanks.
- Attachments
-
- Capture.PNG (39.76 KiB) Viewed 2774 times
- Vrutangkumar Shah
- Posts: 3
- Joined: Mon Feb 06, 2017 4:55 pm
Re: Getting Matlab OpenSim interface to work
I have tried with running Matlab as administrator. Now it is showing me this error as attached.
Then I looked up in the troubleshooting given in http://simtk-confluence.stanford.edu:80 ... ith+Matlab. But still I am getting this error.
Would you please help me out in resolving this issue?
Thanks!
Then I looked up in the troubleshooting given in http://simtk-confluence.stanford.edu:80 ... ith+Matlab. But still I am getting this error.
Would you please help me out in resolving this issue?
Thanks!
- Attachments
-
- Capture.PNG (47.03 KiB) Viewed 2756 times
- Thomas Uchida
- Posts: 1793
- Joined: Wed May 16, 2012 11:40 am
Re: Getting Matlab OpenSim interface to work
This error message appears to be addressed in the first bullet of the Troubleshooting section on the "Scripting with Matlab" page (http://simtk-confluence.stanford.edu:80 ... ith+Matlab). Have you added the OPENSIM_INSTALL_DIR\bin directory to your system PATH variable?
Re: Getting Matlab OpenSim interface to work
If you are running a newer version of Matlab, the automated method may not be working correctly. This is because we haven't had a new OpenSim release in awhile.
Have you tried the manual method (detailed on the page you linked)? I would make sure that LibraryPath.txt, classpath.txt are correct and OpenSim/bin is in the Matlab path. Make sure you restart Matlab (I have forgotten that in the past).
Have you tried the manual method (detailed on the page you linked)? I would make sure that LibraryPath.txt, classpath.txt are correct and OpenSim/bin is in the Matlab path. Make sure you restart Matlab (I have forgotten that in the past).
- Vrutangkumar Shah
- Posts: 3
- Joined: Mon Feb 06, 2017 4:55 pm
Re: Getting Matlab OpenSim interface to work
Yes, I have added. Just now my problem is solved.
I just closed Matlab and open once again, set the path OpenSim 3.3/bin
and type: "model = org.opensim.modeling.Model()" and it did worked without any error.
Now I am able to run example codes.
Thanks for all your time and help!
I just closed Matlab and open once again, set the path OpenSim 3.3/bin
and type: "model = org.opensim.modeling.Model()" and it did worked without any error.
Now I am able to run example codes.
Thanks for all your time and help!
- Jordan Skaro
- Posts: 1
- Joined: Wed Feb 24, 2016 10:24 pm
Re: Getting Matlab OpenSim interface to work
Hi,
I'm getting the same errors as well. I've done the manual setup for matlab to opensim and importing the models works. When I try to run the "createActuatorsFile.m" it get the following errors,
"Required library failed to load. Check that the dynamic library osimJavaJNI is in your PATH"
"java.lang.UnsatisfiedLinkError:C:\OpenSim 3.3\bin\osimJavaJNI.dll: Can't find dependent libraries"
I've also gone through the troubleshooting on https://simtk-confluence.stanford.edu:8 ... ith+Matlab
as in I made sure OpenSim was in the system path when I installed it. I did get a path too long error though. Then I've reinstalled visual studio package.
Been struggling with this for a while.
Thanks in advance for any help!
I'm getting the same errors as well. I've done the manual setup for matlab to opensim and importing the models works. When I try to run the "createActuatorsFile.m" it get the following errors,
"Required library failed to load. Check that the dynamic library osimJavaJNI is in your PATH"
"java.lang.UnsatisfiedLinkError:C:\OpenSim 3.3\bin\osimJavaJNI.dll: Can't find dependent libraries"
I've also gone through the troubleshooting on https://simtk-confluence.stanford.edu:8 ... ith+Matlab
as in I made sure OpenSim was in the system path when I installed it. I did get a path too long error though. Then I've reinstalled visual studio package.
Been struggling with this for a while.
Thanks in advance for any help!