Performance / JShell lightweight

Robert Scholte rfscholte at apache.org
Mon Aug 14 20:24:25 UTC 2017


Hi,

I've started a library which has the ability to divide a set of jars and  
output directories over the classpath and modulepath. In order to get the  
modulename it calls the Java 9 code for retrieving that name, i.e. via  
ModuleFinder.
In case the library runs on Java 9, it can call the ModuleFinder directly.  
But in case the library runs on Java 7 or Java 8, it requires a reference  
to the Java 9 home.
With JShell it has become very easy to execute this code, otherwise I need  
to have an executable-jar at runtime, put is somewhere where I can call it.

However, this call to JShell takes several seconds to resolve, which feels  
quite long. I'm looking for a way to reduce this time.

I'm not interested in interaction with JShell, only interested in the  
output. (in the end it is almost as simple as a main method with  
System.out.println("Hello World"); )

If the startup overhead is caused by building up the shell, can there be  
an option introduced to just execute code without interactive shell (and  
auto-exit at the end)?

thanks,
Robert


More information about the kulla-dev mailing list