Cannot plot demo in java

Hi everyone
I have a function used plot demo in matlab, I exported it to Java SDK and run it in eclipse IDE on Mac OS 10.14.4.
My java code in eclipse is just simple:
import com.mathworks.toolbox.javabuilder.MWException;
import plotDemo.PlotDemo;
public class Test {
public static void main( String[] args )
{
try {
PlotDemo demo = new PlotDemo();
demo.plotDemo();
} catch (MWException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
Then, when run it, I got a exception:
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: Can't load library: /System/Library/Frameworks/gluegen-rt.Framework/gluegen-rt
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1827)
at java.lang.Runtime.load0(Runtime.java:809)
at java.lang.System.load(System.java:1086)
at com.jogamp.common.jvm.JNILibLoaderBase.loadLibraryInternal(JNILibLoaderBase.java:596)
at com.jogamp.common.jvm.JNILibLoaderBase.access$000(JNILibLoaderBase.java:63)
at com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNILibLoaderBase.java:95)
at com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary(JNILibLoaderBase.java:459)
at com.jogamp.common.os.DynamicLibraryBundle$GlueJNILibLoader.loadLibrary(DynamicLibraryBundle.java:421)
at com.jogamp.common.os.Platform$1.run(Platform.java:317)
at java.security.AccessController.doPrivileged(Native Method)
at com.jogamp.common.os.Platform.<clinit>(Platform.java:287)
at com.jogamp.opengl.GLProfile.<clinit>(GLProfile.java:146)
at com.jogamp.opengl.GLCapabilities.<init>(GLCapabilities.java:84)
at com.mathworks.hg.peer.JavaSceneServerPeer.getCaps(JavaSceneServerPeer.java:214)
at com.mathworks.hg.peer.JavaSceneServerPeer.doCreateCanvas(JavaSceneServerPeer.java:925)
at com.mathworks.hg.peer.JavaSceneServerPeer.access$500(JavaSceneServerPeer.java:54)
at com.mathworks.hg.peer.JavaSceneServerPeer$2.run(JavaSceneServerPeer.java:890)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
I have research on gg but can't resolve this problem. I'm a beginner, please help me.
I will appreciate your help very much. Thank you in advance

Answers (0)

Categories

Asked:

on 20 Apr 2019

Edited:

on 20 Apr 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!