|
|
# Frequently Asked Questions
|
|
|
|
|
|
## Java Virtual Machine problems
|
|
|
|
|
|
One common failure is that the JCC package cannot reach the java virtual machine.
|
|
|
The location varies on different platforms and on different java versions.
|
|
|
|
|
|
Note that for the anaconda package of Orekit, there is a setup and takedown script that is run when an environment is activated (`activate myenv`) that sets JCC_JDK. If you access the python executable without activating the environment you may need to set these by hand, or by using "condawrapper" that creates a directory with executables that upon starts enables the environment.
|
|
|
|
|
|
### Mint Linux
|
|
|
|
|
|
for open-jdk it seems that the `libjvm.so` is not added to the library path by itself.
|
|
|
Add the path to `libjvm.so` to a file in `/etc/ld.conf.d/` such as `java.conf` such as:
|
|
|
|
|
|
`/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server`
|
|
|
|
|
|
Then run `sudo ldconfig` and check if it is there by: `ldconfig -p | grep jvm`
|
|
|
|
|
|
You might need to set the enviroment variable JCC_JDK. Example:
|
|
|
|
|
|
`export JCC_JDK=/usr/lib/jvm/java-7-openjdk-amd64`
|
|
|
|
|
|
### Windows
|
|
|
|
|
|
Needs to set the variable JCC_JDK and include java items in the PATH. Example:
|
|
|
|
|
|
```sh
|
|
|
set JCC_JDK=C:\Program Files (x86)\Java\jdk1.6.0_35
|
|
|
set PATH=%JCC_JDK%\jre\bin\client;%JCC_JDK%\bin;%JCC_JDK%\lib;%PATH%
|
|
|
```
|
|
|
|
|
|
These can be etiher set in a bat file or directly in the computer environment variable dialog in windows.
|
|
|
|
|
|
## Python Specific Functions
|
|
|
|
|
|
There are a few python specific functions provided in the [orekit.pyhelpers](https://www.orekit.org/forge/projects/orekit-python-wrapper/repository/revisions/master/entry/wrapper-build/pyhelpers.py) to support the use of the wrapped orekit in python.
|
|
|
|
|
|
`setup_orekit_curdir()` this function adds a data provider with the file [orekit-data.zip](https://gitlab.orekit.org/orekit/orekit/uploads/23fc40bf02c9e5aa9c3784f0e69f0ec1/orekit-data.zip) from the current directory.
|
|
|
|
|
|
## JCC specific stuff
|
|
|
|
|
|
Information about JCC is found at http://lucene.apache.org/pylucene/jcc/features.html
|
|
|
|
|
|
### Casting
|
|
|
|
|
|
Casting is done through the .cast_ method of the class that is the desired class:
|
|
|
|
|
|
```python
|
|
|
sun = CelestialBodyFactory.getSun() # Here we get it as an CelestialBody
|
|
|
sun = PVCoordinatesProvider.cast_(sun) # But we want the PVCoord interface
|
|
|
```
|
|
|
|
|
|
# Debugging
|
|
|
|
|
|
It is possible to do remote debugging of the java part of the wrapper by connecting to the JVM with a debugger, such as eclipse. To enable this, pass the debug arguments to the JVM by using the vmargs options:
|
|
|
|
|
|
`orekit.initVM(vmargs=['-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000'])`
|
|
|
|
|
|
Then connect your debugger to localhost at port 8000. |
|
|
\ No newline at end of file |