Skip to content

Conversation

@msgilligan
Copy link
Member

This is WIP, but gradle secp-examples-jshell:jlink should build an image with a jshell that contains
libsecp256k1 and supports the following (for example)

import org.bitcoinj.secp.api.*
var secp = Secp256k1.get()

This will load the FFM implementation.

Issues:

  • The gradle secp-examples-jshell:jlink target depends on the LIBSECP_DIR which is currently only set up in the Nix devShell.
  • I haven't tried building under CI or on platforms other than macOS
  • I'm not sure if the copyJdkSource task is working properly
  • I haven't figured out how to get secp-api source configured in jshell (if possible)

@msgilligan msgilligan force-pushed the msgilligan/secp-jdk-shell branch 2 times, most recently from 01ee2b2 to 532137d Compare October 25, 2025 16:01
@msgilligan msgilligan force-pushed the msgilligan/secp-jdk-shell branch from 532137d to 5eb9fc7 Compare October 31, 2025 12:36
@msgilligan
Copy link
Member Author

Note that gradle build jlink does not do a full, proper build. It is sometimes necessary to do gradle clean build jlink 🙁

@msgilligan msgilligan force-pushed the msgilligan/secp-jdk-shell branch 4 times, most recently from 1a1deb9 to 72eb464 Compare November 3, 2025 16:20
gradle secp-examples-jshell:jlink` should build an image with a jshell
image that contains libsecp256k1 and supports the following (for example)

import module org.bitcoinj.secp
var secp = Secp256k1.get()

This will load the libsecp256k1-ffm implementation.
@msgilligan msgilligan force-pushed the msgilligan/secp-jdk-shell branch from 72eb464 to 3ddef49 Compare November 4, 2025 19:07
@msgilligan
Copy link
Member Author

There really is no reason to build a custom jlink image just for this purpose. All that is needed is a launcher script and/or some documentation on how to do it in the user guide.

@msgilligan msgilligan closed this Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants