A good way to stay flexible is to write less code. --Pragmatic Programmer

January 11, 2011

Development, ecmascript, Tips & tricks

Comments Off

Today I came across something I don’t think many people know.
Java 6 has a fully functional ECMAscript command line tool, with a interactive console
the cool thing is that you can use all your java libraries from it.
It also has some commands to do file system manipulation like cd and cp etc.

C:\>jrunscript -q
Language ECMAScript 1.6 implemention "Mozilla Rhino" 1.6 release 2
 
C:\>jrunscript -e "var a =1;eval("a=a+1");println(a);
2
 
C:\>jrunscript
js> println(new java.util.Date);
Tue Jan 11 11:55:54 CET 2011
js>