java-bridge
Version 0.99 revision 0 uploaded by JulianFleischer.
Package meta
- Synopsis
- Bindings to the JNI and a high level interface generator.
- Description
This package offers bindings to the Java Native Interface and a high level interface generator.
low level bindings to the JNI
- The low level bindings are located in Foreign.Java.JNI.Safe and Foreign.Java.JNI.Unsafe. When using these bindings you will have to deal with pointers and manage global references manually.
medium level interface
- The medium level interface is located in Foreign.Java. It offers an abstraction over the JNI, i.e. you will not have to deal with pointers explicitly nor do you need to manually do conversions between native types and Haskell types. Also references will automatically be released by the Haskell runtime when no longer needed. You will still need to manually lookup classes and methods in order to use them.
>>> INSTALLATION / USAGE
It should suffice to do
cabal install
(orcabal install java-bridge
when installing from hackageDB). /You need to have a JDK installed prior to installing this library/.Setup will try to find the location of your java installation automatically. This is needed in order to load
libjvm
. Note that this library is loaded dynamically, which means that linking errors might not show up during installation.You can specify the location of
libjvm
manually using the environment variableFFIJNI_LIBJVM
. This environment variable is consulted bySetup.hs
as well as by the library each timelibjvm
is loaded - which means that you can override the path tolibjvm
at any time. The functiongetCompiledLibjvmPath
in Foreign.Java.JNI.Safe will tell you what path tolibjvm
has been set during compilation of the library.>>> FUN WITH (cabal-) FLAGS
The following cabal flags are available to you for configuring your installation:
ONLY_CORE
- Build only the Core Modules which offer a
direct binding to the Java Native Interface.
The core modules are Foreign.Java.JNI,
Foreign.Java.JNI.Safe,
and Foreign.Java.JNI.Unsafe.
This implies
NO_TOOLS
. Defaults toFalse
. DEBUG
- Enable a debug build. Defaults to
False
. OSX_GUI
- Build the library with special support for
Cocoa on Mac OS X (you will not be able to
use AWT or Swing without). Defaults to
True
on Darwin (OS X). OSX_FRAMEWORK
- Use the JavaVM framework on MacOS X instead
of loading the dynamic library. Defaults to
False
. Enable this flag if building on your OS X machine fails. Defaults toFalse
.
Use for example
cabal install -f OSX_FRAMEWORK -f EXAMPLES
orcabal configure -f DEBUG
.- Author
- Julian Fleischer <julian.fleischer@fu-berlin.de>
- Bug reports
- n/a
- Category
- Foreign, Java, JVM, FFI Tools
- Copyright
- n/a
- Homepage
- n/a
- Maintainer
- Julian Fleischer <julian.fleischer@fu-berlin.de>
- Package URL
- n/a
- Stability
- experimental