https://github.com/sridharv/gojava
GoJava - Java bindings for Go packages
https://github.com/sridharv/gojava
Last synced: 4 months ago
JSON representation
GoJava - Java bindings for Go packages
- Host: GitHub
- URL: https://github.com/sridharv/gojava
- Owner: sridharv
- License: apache-2.0
- Created: 2016-03-27T17:55:59.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2018-06-06T00:32:20.000Z (about 8 years ago)
- Last Synced: 2024-06-19T01:51:40.729Z (about 2 years ago)
- Language: Go
- Homepage:
- Size: 20.5 KB
- Stars: 183
- Watchers: 12
- Forks: 15
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-jvm - gojava - Java bindings for Go packages. (Languages)
README
## GoJava - Java bindings to Go packages [](https://travis-ci.org/sridharv/gojava)
GoJava uses a [forked version of gomobile](https://github.com/sridharv/gomobile-java) to generate Java bindings to Go packages.
The same set of types are supported. Details on how the binding works can be found [here](https://godoc.org/golang.org/x/mobile/cmd/gobind).
### Usage
```
gojava [-v] [-o ] [-s ] build [, [...]]
This generates a jar containing Java bindings to the specified Go packages.
-o string
Path to write the generated jar file. (default "libgojava.jar")
-s string
Additional path to scan for Java source code. These files will be compiled and
included in the final jar.
-v Verbose output.
```
You can include the generated jar in your build using the build tool of your choice.
The jar contains a native library (built for the build platform) which is loaded automatically.
Cross platform builds are not currently supported.
NOTE: This has only been tested on an OSX developer machine and Linux (on Travis) and not in production.