Claude nailed JNI glue code, then invented methods that don't exist
A Lua interface to JNI, then a JTOpen wrapper for IBM i message queues. Fed the docs, Claude generated most of it, with nearly perfect JNI signatures, but invented a couple of methods that don't exist.
Done withClaudeSpotted· by HN user MyOutfitIsVague· Nov 4, 2026
Result Cost between $0.05 and $1 per request to run
“notably, Claude did nearly perfect at generating JNI method signatures that it inferred from the Javadocs; as a counterpoint, it did generate interfaces for a couple methods that didn't actually exist”
Spotted: found in the wild. Details are as reported by the source above and have not been independently verified.
What they did
At work the writer had to build an interface for JNI in Lua, then use it to make a wrapper around JTOpen for talking to IBM i message queues. They fed Claude their existing Lua interfaces and the JNI docs for the first part, then the JTOpen Java docs for the wrapper.
How it went
The writer did a lot of the fiddly bits themselves, but most of the interface came out without a problem, needing some cleanup and optimization, and it definitely saved time. Claude did nearly perfect at inferring JNI method signatures from the Javadocs; as a counterpoint, it generated interfaces for a couple of methods that didn’t actually exist.
Try it yourself with Claude
I'm building a [JNI interface in Lua] for [an existing library]. Here are my current Lua interfaces: [paste]. Here's the library's Java docs: [paste or link]. Generate the wrapper code, then I'll review every line, especially the method signatures, before I use it.
A starting prompt written by Agents in the Wild. Fill in the [brackets], and check what the agent does before it sends, pays for or deletes anything.
Wanting Claude's help with Haiku software and OS issues, they spent $30 of Claude API credit on a USB UAC 2 audio driver for Focusrite Scarlett devices. Haiku's AI policy keeps it from going upstream.
Copy-pasting others' TLA+ specs risked missing attribution. Claude built a small Rust package manager that renames modules to avoid collisions. It took about 30 minutes of fighting, but it worked.
A $5-a-month product, then $20, then a rewrite at $10 and $50 a month. A day after launch came a $360 payment: a Yearly option on the $50 plan, with a discount, that Claude had added without them realizing.
Harvest's ~$100/yr Solo time-tracking plan went up 2.5x for a more restricted plan, or $20,000/yr to keep the old one. With their data downloaded, Claude vibecoded a fully-featured clone in one evening.
Asked for a web-based Rust email client from scratch that could talk to a JMAP server, Claude wrote it in about 20 minutes. It needed some bugs pointed out and lacks features, but it works.
A tag-based file recommender kept missing the mark with Claude. ChatGPT turned the problem into one precise paragraph. Handed back to Claude, it clicked, and a working solution came out without any drama.