Adding direct Java capabilities to GreasySpoon

Java support is automatically enabled when running GreasySpoon using a Java JDK. The following steps are only needed when using a JRE, in order to add compilation capabilities to GS.


Since version 1.0.x, language extensions are pre-packaged in order to easier installation. To install Java package:
 
» download Java package for GreasySpoon here
 
» copy the package in {$gs}/pkg/ directory
 
» Install it using either the web interface (Maintenance>>Scripting>>Language packs) or the greasyspoon -e (unix) or greasyspoon.bat (windows) shell command.
 
Note: These functions require GreasySpon to run with admin (root) privileges and there are known limitations regarding packages installation/removal.
 
» restart GreasySpoon



In order to call external Java classes from your scripts, simply create a jar file and add it to the {$gs}/lib directory. You will then be able to import it in your Java scripts using "import mypackage.myclass;" statement.

Note:
» Libs are automatically detected and loaded at runtime: you don't have to restart GS when adding it
» However, you cannot update already deployed libs (same package name, same class names) at runtime. To do so, stop GS, update the desired jar files and restart GS.