.mexa64 file doesn't execute
<p>I have created a mex file but when I try to execute it I get this error in the command line:</p>

<pre><code>java.lang.UnsatisfiedLinkError: no nativeservices in java.library.path
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.loadLibrary0(Unknown Source)
    at java.lang.System.loadLibrary(Unknown Source)
    at com.mathworks.services.Prefs.&lt;clinit&gt;(Prefs.java:167)
    at com.mathworks.fatalexit.FatalExitFrame.&lt;init&gt;(FatalExitFrame.java:137)
    at com.mathworks.fatalexit.FatalExitFrame$13.run(FatalExitFrame.java:770)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$200(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: com.mathworks.services.Prefs.nativeGetPreferencesDirectory()Ljava/lang/String;
    at com.mathworks.services.Prefs.nativeGetPreferencesDirectory(Native Method)
    at com.mathworks.services.Prefs.getPropertyDirectory(Prefs.java:198)
    at com.mathworks.services.Prefs.load(Prefs.java:254)
    at com.mathworks.services.Prefs.&lt;clinit&gt;(Prefs.java:174)
    at com.mathworks.fatalexit.FatalExitFrame.&lt;init&gt;(FatalExitFrame.java:137)
    at com.mathworks.fatalexit.FatalExitFrame$13.run(FatalExitFrame.java:770)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$200(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
Killed
</code></pre>

<p>I am using Ubuntu 16.04 and MatlabR2016b with an official license. I am new to ubuntu and to .mex files so I don't really know what's going on. </p>