[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orekit Users] Library not loaded: @rpath/libjava.dylib on Mac 10.8.5 ?



Hi Mike,

I ran in to this issue before, but I'm trying to remember how I solved it. I think I ended up adding a sym link from /usr/local/lib (or the Mac equivalent) to libjava.dylib. For some reason the java runtime library isn't on the library path by default in Mac.

Hope it helps,
Evan

On 01/23/2015 03:31 PM, Michael Corvin wrote:
Bonne Année!

While trying to import orekit in Python on my Mac I'm getting a "Library not loaded: @rpath/libjava.dylib" error.

I'm running on OSX 10.8.5 and Anaconda Python.  I've set JAVA_HOME and PATH to point at a fairly recent Java 1.7.  I used the conda install commands to get jcc and orekit 7, both of which appeared to install without error and are in the conda list.  The orekit-7.0.jar and the commons-math jar are in the site packages under in the anaconda directories.

Here is my Java environment:

~ > echo $PATH
/Users/zwork/anaconda/bin:/opt/subversion/bin:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/git/bin:/usr/texbin:/Users/zwork/bin:.:/Applications/Julia-0.3.2.app/Contents/Resources/julia/bin:~/Applications/PlantUML
~ > echo $JAVA_HOME 
/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home
~ > find $JAVA_HOME -name libjava.dylib
/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/libjava.dylib
~ > java -version
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)

And here is the import error in Python:

~ > python
Python 2.7.9 |Anaconda 2.1.0 (x86_64)| (default, Dec 15 2014, 10:37:34) 
[GCC 4.2.1 (Apple Inc. build 5577)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
>>> import orekit
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/zwork/anaconda/lib/python2.7/site-packages/orekit-7.0.0-py2.7-macosx-10.5-x86_64.egg/orekit/__init__.py", line 2, in <module>
    import os, _orekit
ImportError: dlopen(/Users/zwork/anaconda/lib/python2.7/site-packages/orekit-7.0.0-py2.7-macosx-10.5-x86_64.egg/orekit/_orekit.so, 2): Library not loaded: @rpath/libjava.dylib
  Referenced from: /Users/zwork/anaconda/lib/python2.7/site-packages/orekit-7.0.0-py2.7-macosx-10.5-x86_64.egg/orekit/_orekit.so
  Reason: image not found

The same error occurs when trying to import the jcc package by itself.   The error also occurred with the environment configured to point at the (old) default Java 1.6 in /System/Library (but that version did not appear to have a libjava.dylib).

Do I need to export a JCC_JDK environment variable and additional path items similar to what is indicated for Windows installations?

I have been using Orekit 1.6 from Matlab very successfully, but want to transition my implementations to Python (and Julia!).

Thanks for any suggestions/hints/fixes!

- Mike Corvin

This e-mail and message, including all attachments, is intended only for the use of the individual or entity to which it is addressed, and may contain information that is privileged, confidential and/or exempt from disclosure under applicable law. If you are not the intended recipient, or the employee, or agent responsible to the intended recipient, you are hereby notified that any disclosure, distribution, dissemination, downloading, copying, or taking of action based on the contents of this message is prohibited. If you have received this e-mail in error, please notify the sender of the e-mail, and delete the e-mail immediately from your computer.