https://github.com/juntaki/javago
Java JNI wrapper code generator for Go
https://github.com/juntaki/javago
Last synced: 6 months ago
JSON representation
Java JNI wrapper code generator for Go
- Host: GitHub
- URL: https://github.com/juntaki/javago
- Owner: juntaki
- License: mit
- Created: 2017-10-10T15:36:00.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-11T10:21:22.000Z (almost 8 years ago)
- Last Synced: 2025-03-27T15:21:25.985Z (7 months ago)
- Language: Go
- Homepage:
- Size: 7.81 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# javago
Java wrapper code generator for Go.
## How to use
Install jnigo javago
~~~
go get github.com/juntaki/jnigo
go get github.com/juntaki/javago
~~~Run command
~~~
$ javago -h
NAME:
javago - Java binding generator for GoUSAGE:
javago [global options] command [command options] [arguments...]VERSION:
0.0.0COMMANDS:
help, h Shows a list of commands or help for one commandGLOBAL OPTIONS:
--classpath value Specifies the path the javap command uses to look up classes. (default: "*:.")
--classfile value classfile
--help, -h show help
--version, -v print the version
~~~e.g. generate java.lang.Math wrapper code.
Generated file is in sample directory in this repository.~~~
$ javago --classfile java.lang.Math
$ ls java
java.lang.Math.go
~~~## Run your app with javago wrapper
Don't forget to add libjvm.so's directory to LD_LIBRARY_PATH.
### for debian/ubuntu
~~~
export LD_LIBRARY_PATH=/usr/lib/jvm/default-java/jre/lib/amd64/server
export CLASSPATH="." # add your classpath
go build
./yourapp
~~~### for mac
~~~
export JAVA_HOME=`/usr/libexec/java_home`
export LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/server/
export CLASSPATH="."
go build
./yourapp
~~~