Copy > sdk list java;
> sdk install java 20.2.0.r11-grl;
> sdk use java 20.2.0.r11-grl
Copy > git clone git@github.com:kiview/testcontainers-prod-src-example.git
> cd testcontainers-prod-src-example
> ./gradlew shadowJar
> ls build/libs/testcontainers-prod-src-example-1.0-SNAPSHOT-all.jar
Copy const readline = require ( 'readline' );
var GenericContainer = Java .type ( 'org.testcontainers.containers.GenericContainer' );
var container = new GenericContainer ( "nginx" );
container .setExposedPorts ([ 80 ]);
container .start ();
console .log ( container .getContainerIpAddress () + ':' + container .getMappedPort ( 80 ));
const rl = readline .createInterface ({
input : process .stdin ,
output : process .stdout
});
rl .question ( 'Type something to quit? ' , (answer) => {
console .log ( `Thank you! Bye!` );
rl .close ();
});
Copy > $JAVA_HOME/bin/node --polyglot --jvm \
--vm.cp = . ./testcontainers-prod-src-example/build/libs/testcontainers-prod-src-example-1.0-SNAPSHOT-all.jar \
index.js