Matlab Builder JA libtbb.dylib error - java

I've been trying to run the hello world example in Java, compiled using Matlab Builder JA
on an Intel Mac with Snow Leopard. When i run the .jar on the terminal i get the following error:
java.lang.LinkageError: dlopen(/Applications/MATLAB_R2011a.app/bin/maci64/libnativemcl.jnilib, 9):
Library not loaded: libtbb.dylib
Referenced from: /Applications/MATLAB_R2011a.app/bin/maci64/libut.dylib
Reason: image not found
at com.mathworks.toolbox.javabuilder.internal.DynamicLibraryUtils.dlopen(Native Method)
at com.mathworks.toolbox.javabuilder.internal.DynamicLibraryUtils.loadLibraryAndBindNativeMethods(DynamicLibraryUtils.java:131)
at com.mathworks.toolbox.javabuilder.internal.MWMCR.<clinit>(MWMCR.java:1554)
at hellopck.HellopckMCRFactory.newInstance(HellopckMCRFactory.java:49)
at hellopck.HellopckMCRFactory.newInstance(HellopckMCRFactory.java:60)
at hellopck.hellocls.main(hellocls.java:114)
I guess it has something to do with my environment variables but i can't find the exact problem. My environment vars are set as:
DYLD_LIBRARY_PATH= /Applications/MATLAB_R2011a.app/runtime/maci64
:/Applications/MATLAB/MATLAB_Compiler_Runtime/v715/bin
XAPPLRESDIR= /Applications/MATLAB_R2011a.app/X11/app-defaults
I 've seen a few similar posts but non of the solutions seems to work

I 've set the DYLD_LIBRARY_PATH as follows and it worked.
DYLD_LIBRARY_PATH= :/Applications/MATLAB/MATLAB_Compiler_Runtime/v715/runtime/maci64:
/Applications/MATLAB/MATLAB_Compiler_Runtime/v715/bin/maci64:
/Applications/MATLAB/MATLAB_Compiler_Runtime/v715/sys/os/maci64

The DYLD_LIBRARY_PATH variable you listed,
DYLD_LIBRARY_PATH= /Applications/MATLAB_R2011a.app/runtime/maci64 :/Applications/MATLAB/MATLAB_Compiler_Runtime/v715/bin
has a space in it (after maci64 and before :/Applications). If that is not a typo in your question, then I think it could be the problem.

Related

Set up MPJ Express in eclipse

I keep obtaining the same identical error as here.
I'm running eclipse under linux mint 17.3.
I've tried to add to MPJ_HOME to system variables writing this command on the terminal: export MPJ_HOME=/path/to/mpj/ (giving the real path to the folder of mpj) but the when I compile eclipse keep telling me:
[MPJRun.java]:[MPJRun.java]:MPJ_HOME environment found..
java.lang.Exception: [MPJRun.java]:MPJ_HOME environment found..
at runtime.starter.MPJRun.<init>(MPJRun.java:155)
at runtime.starter.MPJRun.main(MPJRun.java:1238)
How can I solve? I've already defined MPJ_HOME in Eclipse.
Finally I find out where the problem was!
I already have inserted in RunConfiguration>Tab "Arguments">Button "Variables...">Edit Variable>New Variable the correct values:
Name: MPJ_HOME
Value: /path/to/mpj
Description: [What you want]
and in RunConfiguration>Tab "Arguments">TextField "VM Arguments" this value: -jar ${MPJ_HOME}/lib/starter.jar -np 4
After that I missed to do so:
RunConfiguration>Tab "Environment">New... and insert the following values:
Name: MPJ_HOME
Value: ${MPJ_HOME}
With this configuration everything is working.
I know that this is a real stupid problem but I hope that this answer could help someone.

JRuby 9.0.5.0 cannot load compiled ruby files

Our application is a RoR app, and currently uses JRuby version 1.7.22, and JRE 8_65. Our app is an on-prem solution, so we use JRuby to host our application on JVM at the target, Windows Server 2012 R2 system. We compile our ruby code, using
jruby -S jrubyc
This takes the .rb file and compiles it to a .class file. In the original .rb, it loads in the class file, like so.
load __FILE__.sub(/\.rb$/, ".class")
This all works with JRuby 1.7.22
Now, we want to update JRuby to 9.0.5.0, but are experiencing some problems when it comes to deploying our application. Basically, that line of code above inside of the .rb file is not working anymore, and we get the error when trying to run a rake db:setup
rake aborted!
LoadError: C:/appname/app/models/app_attribute.class is not compiled Ruby; use java_import to load normal classes
C:/appname/app/models/app_attribute.rb:1:in `<top>'
C:/appname/db/seeds.rb:10:in `<top>'
C:/appname/db/seeds.rb:9:in `block in (root)'
Tasks: TOP => db:setup => db:seed
(See full trace by running task with --trace)
Great. So I replace load with java_import
rake aborted!
ArgumentError: not a valid Java identifier: C:/appname/app/models/app_attribute.class
uri:classloader:/jruby/java/core_ext/object.rb:43:in `block in java_import'
uri:classloader:/jruby/java/core_ext/object.rb:34:in `java_import'
C:/appname/app/models/app_attribute.rb:1:in `<top>'
C:/appname/db/seeds.rb:10:in `<top>'
C:/appname/db/seeds.rb:9:in `block in (root)'
Tasks: TOP => db:setup => db:seed
(See full trace by running task with --trace)
Still not working, no matter what I try. I looked at this post: https://github.com/jruby/jruby/issues/3018
I tried to pass the parameter
jruby -Xaot.loadClasses=true
But I get a warning saying that aot.LoadClasses is not recognized. EVEN THOUGH I see it in the properties when I type
jruby -Xproperties
I have done A LOT of research on this, and have probably have looked at everything on the internet regarding this. Any input will be greatly appreciated. Is there something I missing? I am not fully adept in Java.
Thank you.
might be the same issue as https://github.com/jruby/jruby/issues/3651
which means you'll need to wait for 9.1 or use a snapshot http://ci.jruby.org/
since, the error is slightly different you should look into reproducing with snapshot and if it fails (might be Windows related) a step-by-step reproduction might speed-up getting the issue resolved.
jruby -Xaot.loadClasses=true
this is not needed with Warbler
But I get a warning saying that aot.LoadClasses is not recognized. EVEN THOUGH I see it in the properties when I type
hmm, could you reproduce this with an empty script and no JRUBY_OPTS ?
I have done A LOT of research on this, and have probably have looked at everything on the internet regarding this. Any input will be greatly appreciated.
you might want to try looking into the issue next time :) or considering getting some support
Is there something I missing? I am not fully adept in Java.
you shouldn't be missing anything - its not a Java issue ...

Java error while running maxent in biomod2

I am running maxent from R, in the package biomod2 and the following error appeared. I do not come from a technical background and wasn't sure why is this error happening. Is it a memory problem or someone said the java path is not set. But I followed the instructions to set maxent to run in R and also downloaded Java Platform, Standard Edition Development Kit and set a path for it as explained in this pdf: http://modata.ceoe.udel.edu/dev/dhaulsee/class_rcode/r_pkgmanuals/MAXENT4R_directions.pdf
I would be really grateful if you could help me understand this problem and any solution to it.
Thanks a lot
Error in file(file, "rt") : cannot open the connection
In addition: Warning messages:
1: running command 'java' had status 1
2: running command 'java -mx512m -jar E:\bioclim_2.5min\model/maxent.jar environmentallayers
="rainfed/models/1432733200/m_47203134/Back_swd.csv"
samplesfile="rainfed/models/1432733200/m_47203134/Sp_swd.csv"
projectionlayers="rainfed/models/1432733200/m_47203134/Predictions/Pred_swd.csv"
outputdirectory="rainfed/models/1432733200/rainfed_PA1_Full_MAXENT_outputs"
outputformat=logistic redoifexists visible=FALSE linear=TRUE quadratic=TRUE
product=TRUE threshold=TRUE hinge=TRUE lq2lqptthreshold=80 l2lqthreshold=10
hingethreshold=15 beta_threshold=-1 beta_categorical=-1 beta_lqp=-1
beta_hinge=-1 defaultprevalence=0.5 autorun nowarnings notooltips
noaddsamplestobackground' had status 1
3: In file(file, "rt") :
cannot open file 'rainfed/models/1432733200/rainfed_PA1_Full_MAXENT_outputs/rainfed_PA1_
Full_Pred_swd.csv': No such file or directory
I've just manage to solve this problem - it is a problem with the file path specified. For me, I had a space in one of the folder names which was not accepted in the path to the maxent.jar file. From looking at your error, it looks like it might be the two backslashes.
E:\bioclim_2.5min\model/maxent.jar
should probably read
E:/bioclim_2.5min/model/maxent.jar

Play framework runtime error on OS X

I'm trying to install Play 2.2 on a fresh MacBook Pro with Java 7. Scala has already been installed. Here's what I get:
Okihara-MacBook-Pro:Extensions okihara$ play help
Exception in thread "main" java.lang.IncompatibleClassChangeError: Expected static method scala.Array$.unapplySeq(Ljava/lang/Object;)Lscala/Option;
at xsbt.boot.Boot$.main(Boot.scala:14)
at xsbt.boot.Boot.main(Boot.scala)
I saw Issue getting SBT to work on Mac OS X but there's no conclusive answer. I tried running the Scala REPL and that seems to work well too.
I only used Play on Linux before, this is my first attempt to install it on OS X.
Where should I look?
EDIT
As done in the other SO question, I get the above message with the scala-* jars in the Library/Java/Extensions folder. If I remove them, I get:
Okihara-MacBook-Pro:Extensions okihara$ play
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.ivy.core.RelativeUrlResolver.$init$$6ce060cb(Lscala/collection/mutable/HashTable$HashUtils;)V
at scala.collection.mutable.HashMap.<init>(HashMap.scala:39)
at scala.collection.mutable.HashMap.<init>(HashMap.scala:55)
at scala.collection.mutable.Map$.empty$7fee4dfc(Map.scala:68)
at scala.collection.generic.MutableMapFactory.newBuilder(MutableMapFactory.scala:29)
at scala.collection.generic.GenMapFactory.apply$41cb962a(GenMapFactory.scala:47)
at scala.sys.SystemProperties$.propertyHelp$lzycompute(SystemProperties.scala:62)
at scala.sys.SystemProperties$.noTraceSupression$lzycompute(SystemProperties.scala:80)
at scala.sys.SystemProperties$.noTraceSupression(SystemProperties.scala:80)
at scala.util.control.NoStackTrace$.<init>(NoStackTrace.scala:31)
at scala.util.control.NoStackTrace$.<clinit>(NoStackTrace.scala)
at scala.util.control.BreakControl.fillInStackTrace(Breaks.scala:93)
at java.lang.Throwable.<init>(Throwable.java:250)
at scala.util.control.BreakControl.<init>(Breaks.scala:93)
at scala.util.control.Breaks.<init>(Breaks.scala:28)
at scala.collection.Traversable$.<init>(Traversable.scala:96)
at scala.collection.Traversable$.<clinit>(Traversable.scala)
at scala.package$.<init>(package.scala:46)
at scala.package$.<clinit>(package.scala)
at scala.Predef$.<init>(Predef.scala:90)
at scala.Predef$.<clinit>(Predef.scala)
at scala.Array$.unapplySeq(Array.scala:443)
at xsbt.boot.Boot$.main(Boot.scala:14)
at xsbt.boot.Boot.main(Boot.scala)
Removing ivy-*.jar from /Library/Java/Extensions solved the
issue.
FWIW, I also have no scala*.jar in the extensions folder and I'm running Java 1.7.0_21. Play is symlinked as advised. HTH.

java UnsatisfiedLinkError awt.image

I have a program that makes use of the following method to get a scaled instance of an image icon:
public ImageIcon createScaledImageIcon(String filename) {
ImageIcon icon = new ImageIcon(filename);
Image image = icon.getImage().getScaledInstance(cardWidth, cardHeight, Image.SCALE_SMOOTH);
icon.setImage(image);
return icon;
}
I don't know if it's the source of the problem or not. But i get the following error messages:
Exception in thread "Image Fetcher 0" java.lang.UnsatisfiedLinkError: sun.awt.image.ImageRepresentation.setBytePixels(IIII[BIILsun/awt/image/ByteComponentRaster;I)V at sun.awt.image.ImageRepresentation.setBytePixels(Native Method)
at sun.awt.image.ImageRepresenation.setPixels(Unknown Source)
at sun.awt.image.ImageDecoder.setPixels(Unknown Source)
at sun.awt.image.GIFImageDecoder.sendPixels(Unknown Source) ...
Let me know if there is any other information I could include that might be of use.
Try reinstalling the latest version of Java. Your installation may have been incomplete/corrupt (read similar experience).
A user at this link suggests that this error may be the result of receiving a Java response and not rebooting. Whether "rebooting" referes to the entire computer, or just restarting java is unknown, though.
I had this same problem with a Squirrel SQL install on a Windows machine. It turned out that the cause was the environment setting for the PATH. I had set JAVA_HOME to point to the Java version I installed, but there was another version of Java in the path earlier than the one I had installed (which was sitting at the end of the path).
So my JAVA_HOME setting was not right for the version of Java which was actually being run at the command line when you typed "java".
If you see this, you might try making sure that your JAVA_HOME environment variable points to the Java you installed and make sure that it appears first in your path.
javadoc says, Thrown if the Java Virtual Machine cannot find an appropriate native-language definition of a method declared native.
guess java does not know how to read the image u specified.. use a .gif format.

Categories

Resources