|
Categories
Tags
.net
anonimity
conference
digg
ethics
event
injection
internet
java
jruby
macosx
owasp
privacy
scripting
smartphone
sql
ssd
Bloggers
|
Blog @ andreaprovaglio.comThoughts on software development, design and people.
Using 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! NOTE: Comments are moderated and will appear after the moderator has reviewed them. Comments containing offensive or off-topic text will be rejected. Your IP address will be logged. Comments lacking submitter's identification (name and email address) may be rejected. Your email address will not be published and will be used only to notify you of new comments if you request it, unless otherwise required by law enforcement procedures. These rules are in place to keep a high standard in the online discussions. |
RSS Feeds
Blogroll
Search
|