|
Categories
Tags
.net
anonimity
conference
digg
ethics
injection
internet
java
jruby
macosx
owasp
privacy
scripting
smartphone
sql
Bloggers
|
Blog @ andreaprovaglio.comThoughts on software development, design and people.
Jan 09, 2008Using JSR-223 on Java 1.5 and 1.4
Posted at 12:32AM Jan 09, 2008
by Andrea Provaglio in category Programming
I find the Scriping for the Java Platform API (JSR-223) an interesting and promising extension to Java. It's even more appealing to me when used with JRuby (and optionally with Rails). I'll discuss the benefits of such a mix in a future post. For now, I just want to talk about the Java versions on which you can run JSR-223. Although Sun is promoting JSR-223 as a Java6 feature, you can in fact run it on previous versions as well. This is good news for those of us who can't upgrade their servers to a major release so easily - and for those who, like myself, use Mac OS X and are still waiting at the time of this writing for Apple to release a stable Java6 update. All you have to do to run JSR-223 on a Java version preceding Java6 (I tried with Java5) is:
One tricky bit about recompiling the scripting engines is that you'll need to specify in an Ant property the path to the To keep things simple I decided to recompile only the engine I needed (I wanted to use JRuby, remember?), so I commented out from the Ant build script the tasks for all the languages that I didn't need. Eventually, I ended up with a shiny At this point, to be able to compile and run a small Java program which loads and runs a Ruby script, all I had to do was to include in my Java classpath:
That's all. Happy scripting/Java mixing! |
RSS Feeds
Blogroll
Search
|