JRuby: Wiki: JRubyOnWebStart — Project Kenai
Deploying JRuby applications with Java Web Start
Contents [hide]Known Issues
Open JIRA Issues matching "Web Start or jnlp or javaws"
Samples
The samples directory distributed with JRuby has an example jnlp, http://github.com/jruby/jruby/blob/master/samples/irb-applet.html that will start the JRuby Swing IRB console as a Java Web Start application.
See also http://github.com/jruby/jruby/tree/master/samples/jnlp/Here is deployed instance: http://tim.lossen.de/2007/03/jruby/applet.html
Getting jirb.jnlp sample to work in Java 1.5
The jirb.jnlp needs to be modified to work on Java 1.5 because of the use of .. in the codebase attribute, which only works in Java 1.6.
- Make a symbolic link to the directory $JRUBY_HOME/lib in the samples directory (or make a copy of the lib directory).
$ cd $JRUBY_HOME/samples
$ ln -s ../lib- Change the codebase attribute in the jnlp element to use a reference to the local directory.
<jnlp spec="1.0+" codebase="file:.">- Start the jnlp using javaws from the command line.
$ javaws jirb.jnlpNew jnlp samples dir
The following Jira issue includes an attachment that, when extracted in samples/ adds both unsigned and signed examples that work in Java 1.5 and 1.6. It is projected to be included in JRUBY 1.1 RC2.
JAR Signing
If you're getting java.securityAccessControlException with the message access denied (java.lang.RuntimePermission accessDeclaredMembers) on startup or when running your JRuby application, then you need to sign your jar. The whole process is described
here, under "Signing JAR Files with a Test Certificate".You basically have to perform the following steps:
You also need to include to following lines in your jnlp-file:
Whenever you modify the jar, you need to do the following to update the signature:
Disabling the Security Manager
If you have a signed jar and the startup fails because of a java.lang.reflect.ReflectPermission, or you continue to have access denied (java.lang.RuntimePermission accessDeclaredMembers) errors, you can just disable the security manager.
Using JRuby:
Using Java:
Disclaimer: I'm not an expert on Java Security, so I don't know if disabling the Security Manager has unintended side effects. [User:Mstocker|Mstocker] 10:49, 30 December 2007 (PST)
See: JRUBY-1821 and JRUBY-1782.
External Links
http://almaer.com/blog/running-ruby-in-the-browser-via-script-typetextruby has some interesting stuff
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步