Dear all,
I keep getting this error when scripting with matlab:
"Java exception occurred:
java.lang.NoClassDefFoundError: Could not initialize class org.opensim.modeling.opensimModelJNI"
I am using both Opensim and Matlab on a Mac through parallels and both are 32 bit, same for Java.
I have Opensim version 3.2 and 3.3 but I'm currently working with 3.2.
Any suggestions?
Thanks
Could not initialize class org.opensim.modeling.opensimModel
- Clara Balust
- Posts: 3
- Joined: Mon Oct 05, 2015 10:21 am
- Janek Butzer
- Posts: 5
- Joined: Tue Apr 18, 2017 3:05 am
Re: Could not initialize class org.opensim.modeling.opensimModel
Dear all,
I just started using OpenSim and was trying to use the matlab scripting for the DynamicWalker tutorial.
I run both Matlab and OpenSim as 64bit versions. I did the setup according to the setup instructions ("Scripting with matlab") and got no error when typing "model = org.opensim.modeling.Model();". Furthermore I get to see all methods in an OpenSim class when typing "methods Model" and all all method signatures in an OpenSim class when typing "methodsview Model".
But when I try to run the "OpenSimCreateTugOfWarModel.m" the following error occurs:
"Java exception occurred:
java.lang.NoClassDefFoundError: Could not initialize class org.opensim.modeling.opensimModelJNI
at org.opensim.modeling.Model.<init>(Model.java:119)"
Any suggestion what I need to do to solve the problem?
Thanks!
Janek
I just started using OpenSim and was trying to use the matlab scripting for the DynamicWalker tutorial.
I run both Matlab and OpenSim as 64bit versions. I did the setup according to the setup instructions ("Scripting with matlab") and got no error when typing "model = org.opensim.modeling.Model();". Furthermore I get to see all methods in an OpenSim class when typing "methods Model" and all all method signatures in an OpenSim class when typing "methodsview Model".
But when I try to run the "OpenSimCreateTugOfWarModel.m" the following error occurs:
"Java exception occurred:
java.lang.NoClassDefFoundError: Could not initialize class org.opensim.modeling.opensimModelJNI
at org.opensim.modeling.Model.<init>(Model.java:119)"
Any suggestion what I need to do to solve the problem?
Thanks!
Janek
- Thomas Uchida
- Posts: 1790
- Joined: Wed May 16, 2012 11:40 am
Re: Could not initialize class org.opensim.modeling.opensimModel
"NoClassDefFoundError" is thrown when MATLAB is unable to find the necessary runtime libraries (see https://www.mathworks.com/matlabcentral ... -fx-button). If you're using Windows, the first thing you can verify is that the "OpenSim\bin" folder appears in your Windows PATH.
I would then suggest trying the "Manual Setup" instructions on the "Scripting with Matlab" Confluence documentation page (http://simtk-confluence.stanford.edu:80 ... ith+Matlab). Don't forget to restart MATLAB at the end.
I would then suggest trying the "Manual Setup" instructions on the "Scripting with Matlab" Confluence documentation page (http://simtk-confluence.stanford.edu:80 ... ith+Matlab). Don't forget to restart MATLAB at the end.
- Janek Butzer
- Posts: 5
- Joined: Tue Apr 18, 2017 3:05 am
Re: Could not initialize class org.opensim.modeling.opensimModel
Thanks for your quick response. Unfortunatly the error still occurs although I went through the steps described in "manual setup". Furthermore to make sure that there is nothing missing in the matlab software package I installed Matlab R2017a and went through the manual setup with this release as well but this changed nothing.
Any ideas how to proceed?
Thanks a lot for your help!
Any ideas how to proceed?
Thanks a lot for your help!
- Thomas Uchida
- Posts: 1790
- Joined: Wed May 16, 2012 11:40 am
Re: Could not initialize class org.opensim.modeling.opensimModel
Not with the information I have. Do all example scripts fail or just the one you mentioned? What operating system are you using? You mentioned that "I run both Matlab and OpenSim as 64bit versions." Does that mean that you installed 64-bit versions? You can check which OpenSim version you installed by opening <OpenSim installation directory>\sdk\buildinfo.txt.Any ideas how to proceed?
- Janek Butzer
- Posts: 5
- Joined: Tue Apr 18, 2017 3:05 am
Re: Could not initialize class org.opensim.modeling.opensimModel
The operating system I'm using is Win7 64bit. Furthermore I use Matlab 2017a (64bit) and OpenSim 3.3 (64bit).
I've attached some screenshots which show the errors that occour and also the matlab search path.
Depending on the "(line ...)" shown in the error-message that causes the problem I think it's always the "model = Model(); function.
What other information can I provide that might be useful?
Thank you for your time and your help!
I've attached some screenshots which show the errors that occour and also the matlab search path.
Depending on the "(line ...)" shown in the error-message that causes the problem I think it's always the "model = Model(); function.
What other information can I provide that might be useful?
Thank you for your time and your help!
- Attachments
-
- Opensim_Matlab_04.JPG (89.42 KiB) Viewed 858 times
-
- Opensim_Matlab_03.JPG (74.51 KiB) Viewed 858 times
-
- Opensim_Matlab_02.JPG (20.95 KiB) Viewed 858 times
-
- Opensim_Matlab_01.JPG (54.06 KiB) Viewed 858 times
- Dimitar Stanev
- Posts: 1096
- Joined: Fri Jan 31, 2014 5:14 am
Re: Could not initialize class org.opensim.modeling.opensimModel
Have you tried adding OpenSim to system path and not just to Matlab's path variable?
- Janek Butzer
- Posts: 5
- Joined: Tue Apr 18, 2017 3:05 am
Re: Could not initialize class org.opensim.modeling.opensimModel
No I haven't tried that before. Thanks for this hint. Now it works ![Smile :)](./images/smilies/icon_e_smile.gif)
![Smile :)](./images/smilies/icon_e_smile.gif)