Broken Java Mac 10.6 - java

Some background:
On Mac OS X 10.6 using Macports and I have DYLD_LIBRARY_PATH set in my .bash_profile.
The problem:
When I run java -version I get this error:
Error occurred during initialization of VM
Unable to load native library: libjava.jnilib
By way of one helpful forum thread, I've discovered the problem is some files in my '/opt/local/lib' directory are causing trouble because of the DYLD_LIBRARY_PATH I've set.
When I remove the files starting with libgif, libjpeg, libpng and libtiff from '/opt/local/lib', the problem goes away and `java -version' works, but the ports that depend on those files break.
Anyone know of a way I can keep the files and still get java to work properly? Possibly setting the java path, which I'm not quite sure how to do and all my attempts have failed.
Thanks.

Don't set DYLD_LIBRARY_PATH. Because of this env var, the dynamic linker dyld, is finding /opt/local/lib/libjpeg.dylib etc. instead of the different /System/Library/Frameworks//ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Resources/libJPEG.dylib that it needs.

This seems to work on OS X Lion:
unset DYLD_LIBRARY_PATH

Seems one possible cause of this a file protection problem? See my post over in this other thread.

Related

Installing Elasticsearch 5.0.2 on Windows 8 - \config\jvm.options "was unexpected at this time"

I'm new to Stack Overflow (though a long time lurker).
I'm struggling to install elasticsearch on my laptop. It's windows 8, I've just updated java to Java 8 and I've set the new path using set JAVA_HOME.
However, whenever I try to run the elasticsearch.bat file on the command line, I get this error:
\elasticsearch-5.0.2\bin\..\config\jvm.options was unexpected at this time
Any help would be greatly appreciated on this matter
I've also tried to setup the ElasticSearch on my Windows 2016 R2 Datacenter (64-bit). Let me share some of my experiences on how to solve this.
Setting up JAVA_HOME
Ensure that you have JDK/JRE installed. You can download it here.
Set the JAVA_HOME environment variable. To do this, open the Start menu and type in "path".
Then click on Environment Variables. If you don't have JAVA_HOME variable set yet, click New.
The JAVA_HOME variable should only lead up to the JDK/JRE directory, not including /bin.
C:\Progra~1\Java\jdk1.8.0_112
Progra~1 corresponds to Program Files. If you use Program Files (x86), change Progra~1 to Progra~2
Restart your computer. Once your computer is restarted, open up CMD and type in echo %JAVA_HOME%. The output should be
C:\Progra~1\Java\jdk1.8.0_112
If you get the following output, your JAVA_HOME is setup correctly.
Running ElasticSearch
The first time I tried to run ElasticSearch, I get the following output.
The odd directory I pointed out here gave me a hint that the batch file might be reading from the wrong directory. So what I did was tinker around with the batch file a bit. Open elasticsearch.bat using any text editor.
Scroll all the way to the end, somewhere above the last lines you'll see something similar to the following.
Remove the highlighted line, save the file and try running the batch file again via command prompt.
It works in my case.
Once you have this, open up your browser and navigate to localhost:9200.
I think that's it?
Your problem is most likely caused by parentheses in the path to where you unzipped and are running Elasticsearch from. The related issue in the Elasticsearch repository is #24712 which will be fixed with Elasticsearch 5.4.1.
Be aware that by applying Nicholas Lie's "fix" you are telling Elasticsearch to effectively ignore all settings in config/jvm.options. While this may help you to start Elasticsearch in this specific case, it will only start with default JVM options which might lead to surprising behavior down the road.

Attempting to Connect my Kinect to Mac and code in Greenfoot Environment

Running: Mac OS X 10.8.5
I'm following the step by step instructions on the Greenfoot website:
http://www.greenfoot.org/doc/kinect/macos.html
I've dealt with all the run arounds with installing Macports for OSX 10.8, and finally installed 'boost', but for the final part, at the bottom of the site I attempt to type the code in terminal at the proper directory to configure it:
./configure --with-boost=/opt/local/include --with-wx-config=/opt/local/bin/wx-config --with-wx-prefix=/opt/local
This is what it gives me and stops at this certain point. It goes through all it's configuring and stops here:
checking for the Boost thread library... no
configure: error: cannot find the flags to link with Boost thread
I've also instead tried to install boost 1.49 instead of boost 1.50(the latest) but no luck there.
Any suggestions?
Same error on Mac OS X 10.9 - from the m4/boost.m4 file from the kinectserver-1.2 directory:
Now let's try to find the library. The algorithm is as follows: first look
for a given library name according to the user's PREFERRED-RT-OPT. For each
library name, we prefer to use the ones that carry the tag (toolset name).
Each library is searched through the various standard paths were Boost is
usually installed. If we can't find the standard variants, we try to
enforce -mt (for instance on MacOSX, libboost_threads.dylib doesn't exist
but there's -obviously- libboost_threads-mt.dylib).
So if there's a convenient way to tweak the source to point to "libboost_threads-mt.dylib" as the target for the "checking for the Boost thread library..." step, that would appear to be the ticket - still looking at what to tweak to accomplish this, though.

Combine CPLEX and JAVA

Java - CPLEX
For a seminar at university I need to program a model with java.
Since it is a maximization problem I also need to involve CPLEX methods. Therefore I successfully installed CPLEX on my Mac OS X Version 10.5.8.
To combine CPLEX and Eclipse (I also tried it with Netbeans) I connected my current project with the CPLEX library (Properties>Library>Add Library).
Eclipse recognizes the library because the methods aren't underlinded. Additionally I committed the following argument to my run configurations:
-Djava.library.path=/Users/myname/Applications/IBM/ILOG/CPLEX_Studio126/cplex/bin/x86-64_osx
When I try to run an exemplary code (that is valid) I get the following error:
java.lang.UnsatisfiedLinkError: /Users/myname/Applications/IBM/ILOG/CPLEX_Studio126/cplex/bin/x86-64_osx/libcplex1260.jnilib: no suitable image found. Did find: /Users/myname/Applications/IBM/ILOG/CPLEX_Studio126/cplex/bin/x86-64_osx/libcplex1260.jnilib: unknown required load command 0x80000022Exception in thread "main" java.lang.UnsatisfiedLinkError: ilog.cplex.Cplex.CPXopenCPLEX([I)J
at ilog.cplex.Cplex.CPXopenCPLEX(Native Method)
at ilog.cplex.CplexI.init(CplexI.java:6594)
at ilog.cplex.CplexI.<init>(CplexI.java:629)
at ilog.cplex.IloCplex.<init>(IloCplex.java:11067)
at ilog.cplex.IloCplex.<init>(IloCplex.java:11082)
at Knapsack.buildModel(Knapsack.java:54)
at Knapsack.main(Knapsack.java:122)
java.library.path must point to the directory containing the CPLEX shared library
try invoking java with java -Djava.library.path=...
could you please be so kind to help me, i don't know any more what to do.
Thank you for an answer
I found this question when having the same problem. followed the advice from the internet and found that I was putting the -Djava.library.path argument in the wrong place... You should really double check not only the paths but also if you put your arguments in the correct place and correctly typed. It seems silly but happens :)
Anyway, in my case, I am using NetBeans, I went to:
Project Properties
Run
in the VM Options text field:
-Djava.library.path=/Applications/IBM/ILOG/CPLEX_Studio126/cplex/bin/x86-64_osx
I hope this will help you
Make sure you closely followed the steps described in 1 for setting up eclipse.
Make sure the environment variable DYLD_LIBRARY_PATH is set in the environment eclipse is running in. See 2. First check if DYLD_LIBRARY_PATH is set. Second try to execute your java program via terminal.

WinRun4J service example doesn't run

Does anyone know how to get the WinRun4J service example (ServiceTest class that is distributed with the software) to run? I'm on a Windows 7 box, 64 bit, and have the Java 7 JDK and JRE installed.
I performed the following:
Copied WinRun4J64c.exe to C:\test, renamed it service64.exe
Copied service.ini to C:\test, renamed it service64.ini
Finally, I copied WinRun4JTest.jar to C:\test.
First off, you have to run a command prompt as Administrator, otherwise you can't register the service. So in a command prompt, opened as Administrator, I entered the command:
C:\Test>service64.exe --WinRun4J:RegisterService
So far so good. But when I go to the Windows services panel to start the service, I get the error:
"Error 1053: service did not respond ... in a timely fashion"
Any ideas?
Thanks
I had the same problem. You need to also copy WinRun4j.jar to the directory as well or somewhere where it can be found in the classpath.
As far as I have understood that you may have forgotten to copy WinRun4JTest.jar to the C:\test.
You may also want to check that you have the appropriate java JRE installed for the 32 and/or 64 bit version of WinRun4J.
A quick way to find this out is to enable logging by adding the following to service.ini:
log=C:/log.txt
log.overwrite=true
And the log should note if your issue is JVM related.
Did you set JAVA_HOME? I was having the same problem and that solved my issue.

ZeroMQ Java Binding LD_LIBRARY_PATH

I'm trying to use ZeroMQ on CentOS.
I followed the install instructions for unix like platforms
I keep getting the following exception when running:
java.lang.UnsatisfiedLinkError: no jzmq in java.library.path
However the following line fixes this problem:
export LD_LIBRARY_PATH=/usr/local/lib
What exactly is this LD_LIBRARY_PATH and why is not explained in the install instructions? Do I need to run this export everytime?
It's a way to specify where to load some native library (.so file) the app is using. You can get that variable defined in the environment in a number of ways, depending on what you need. If you are going to have the MQ start when the os boots, you could put the export in the startup shell script. Or it might go in /etc/bashrc, or it might go in ~/.bashrc It just depends on what you need.
FYI I don't know anything about ZeroMQ itself.

Categories

Resources