3 ms·
This is a stupid question, but it's beyond difficult to search for an answer (I've really tried!): Can I import Java libraries into Go? If I can't find a Go li
by ssmoot 14y ago
This is a stupid question, but it's beyond difficult to search for an answer (I've really tried!):
Can I import Java libraries into Go? If I can't find a Go library to do what I need, what are my options besides messaging to another process, or (presumably) finding a equivalent C library (I don't trust my C skills enough to make wrapping something a confidence inspiring no-brainer).
Is there general language/library interop details out there any golangers could point me towards?
- koenigdavidmj 14y agoSwig (http://www.swig.org/ http://www.swig.org/) can take C++ libraries and let them be accessed from Go.
- jbarham 14y ago> Can I import Java libraries into Go? No. Go compiles to machine code, not the JVM. Go's built in cgo tool makes it very easy to wrap C code. See http://golang.org/doc/articles/c_go_cgo.html http://golang.org/doc/articles/c_go_cgo.html. Crucially, you can write most of the wrapper in pure Go and the C boilerplate code is generated automatically.