Experiments with ruby-processing (processing-2.2.1) and JRubyArt for processing-3.0

Thursday, 2 July 2015

Experimenting with standalone app using jruby

On the jruby wiki there is an explanation of how to create standalone JRuby apps, it appears to be v. old referring to since JRuby-1.6 but I have found it still works with JRuby-9.0.0.0-SNAPSHOT (as of 2 July 2015) see steps I took:-
cp jruby/lib/jruby.jar myapp.jar         # adjust path to jruby.jar
echo "puts 'hello'" >> jar-bootstrap.rb
jar ufe myapp.jar org.jruby.JarBootstrapMain jar-bootstrap.rb
java -jar myapp.jar

output was as expected 'hello'. Perhaps I could harness this for JRubyArt app export?
Here is what my myapp.jar MANIFEST.MF looks like:-
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Built-By: tux
Created-By: Apache Maven 3.3.3
Build-Jdk: 1.8.0_45
Main-Class: org.jruby.JarBootstrapMain

Apparently you can also embed additional .rb files into the jar, and the root of the jar file will be used as an implicit LOAD_PATH entry. Warbler is another option to consider.

No comments:

Post a Comment

Followers

About Me

My photo
I have developed JRubyArt and propane new versions of ruby-processing for JRuby-9.1.5.0 and processing-3.2.2