A new version for jdk11 use, does not require an installed
vanilla processing, however if installed you can use processing-ide to download libraries. Configuration file is incompatible with that of previous version of JRubyArt (and you should move or rename old
config.yml to keep it). This version will run with a default configuration file but you won't be able to use processing libraries, until you match configuration to your setup.
A suitable version of ruby (MRI
ruby 2.3+ or
jruby-184.108.40.206) to download gem.
open-jdk11.03+ currently FX2D is not included. Currently you can ignore
illegal reflective access warnings, see here how to suppress them. There may be a linker issue with P2D or P3D sketches with stock openjdk with some linux distros, in which case you might find Adopt open jdk binaries will work for you.
You can if you wish leave configuration to the
new autoconfig tool (delete or rename existing config to do this). The config file is
config.yml in the
~/.jruby_art folder, the autoconfig gets run on
k9 --install expected to just work.
config.yml on linux
--- processing_ide: true library_path: "/home/tux/sketchbook" MAX_WATCH: 32 JRUBY: true template: bare java_args: # Global java_args can be used to suppress reflective access warn
Suppressing Reflective Access warnings
Since JRuby-220.127.116.11 it is possible to suppress reflective access warnings by including a
~/.jruby.java_opts file with following contents:-
--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.desktop/java.awt=ALL-UNNAMED --add-opens java.desktop/sun.awt=ALL-UNNAMED --add-opens java.desktop/sun.java2d.opengl=ALL-UNNAMED
Mainly needed for opengl sketches.
Install Steps (assumes you have requirements above)
gem install jruby_art k9 --install # installs jruby-complete-18.104.22.168 and downloads and installs samples to ~/k9_samples cd ~/k9_samples/contributed k9 --run jwishy.rb # if you have jruby-22.214.171.124 installed or config `JRUBY: false` # to use jruby-complete set `JRUBY: false` in config
Create sketches from built in templates
k9 --create fred 200 200 # basic sketch fred.rb k9 --create fred 200 200 p2d # basic P2D sketch fred.rb
To create either a
class wrapped sketch or
emacs sketch set
template: class or
template: emacs in config.yml
def setup sketch_title 'My Sketch' end def draw background 0 fill 200 ellipse width / 2, height / 2, 300, 200 end def settings size 400, 300 end
See above be prepared to
KILL the odd java process (ie when sketch does not exit cleanly)
k9 --watch sketch.rb # NB: doesn't work with FX2D render mode
Open pry console on sketch
k9 --live sketch.rb # pry is bound to Processing.app # needs `jruby -S gem install pry`
Worked Examples and, The-Nature-of-Code-Examples-for-JRubyArt feel free to add your own, especially ruby-2.2+ syntax now we can. These can now be downloaded using
k9 --install please move existing
k9_samples if you wish to keep them.