launch single-file source-code programs with kilim and java 11

Skip to first unread message


Aug 30, 2018, 8:25:59 PM8/30/18
to kilimthreads
JEP 330 (Launch Single-File Source-Code Programs) is a jdk enhancement project that "Enhances the java launcher to run a program supplied as a single file of Java source code"

it's part of java 11 and it works with kilim

cp=$(mvn -q dependency:build-classpath -Dmdep.outputFile=/dev/fd/1)
kilim="-javaagent:${cp/:*} -cp $cp"
$java11/bin/java $kilim ../../src/kilim/examples/

currently, the JEP 330 classloader doesn't provide getResource, so i use a javaagent to access the bytecode. but openjdk is committed to implementing that method

so by the time java 11 is released we'll have full support with only needing to supply the classpath

this is available in maven central as org.db4j : kilim : 2.0.0-22-jdk11

Reply all
Reply to author
0 new messages