From: brabuhr@... Date: 2007-11-14T08:52:44+09:00 Subject: Re: Android + JRuby? On Nov 13, 2007 6:41 PM, wrote: > On Nov 13, 2007 3:38 PM, Charles Oliver Nutter wrote: > > John Joyce wrote: > > > Hey Mr. Nutter... > > > Any idea if JRuby will work on Android??? > > > Sure would be cool to have a Ruby angle on phone software, even though > > > there is no Android phone yet... > > > > From a cursory glance at the SDK, I'd say...yes! > > > > I'm not sure yet if everything we need is there, but it would be > > considerably easier to bring JRuby up on Android than on Java ME. Most > > of the packages I expected to be missing are present...so I think > > there's a good chance it could be made to run. > > A simple test: adding jruby-complete.jar onto the dex call in build.xml: > > [exec] ...while processing org/jruby/parser/DefaultRubyParser.class > [exec] 1 error; aborting And copying the entire JRuby source into the Android project. (Removed BSFExample.java and demo since java.awt and javax.swing did not exist.): compile: [javac] Compiling 621 source files to /nas/projects/cameron/public/android_sdk_linux_m3-rc20a/JRubyTest/bin/classes [javac] /nas/projects/cameron/public/android_sdk_linux_m3-rc20a/JRubyTest/src/org/jruby/javasupport/JavaClass.java:38: package java.beans does not exist [javac] import java.beans.BeanInfo; [javac] ^ [javac] /nas/projects/cameron/public/android_sdk_linux_m3-rc20a/JRubyTest/src/org/jruby/javasupport/JavaClass.java:39: package java.beans does not exist [javac] import java.beans.IntrospectionException; [javac] ^ [javac] /nas/projects/cameron/public/android_sdk_linux_m3-rc20a/JRubyTest/src/org/jruby/javasupport/JavaClass.java:40: package java.beans does not exist [javac] import java.beans.Introspector; [javac] ^ [javac] /nas/projects/cameron/public/android_sdk_linux_m3-rc20a/JRubyTest/src/org/jruby/javasupport/JavaClass.java:41: package java.beans does not exist [javac] import java.beans.PropertyDescriptor; [javac] ^ [javac] /nas/projects/cameron/public/android_sdk_linux_m3-rc20a/JRubyTest/src/org/jruby/javasupport/bsf/JRubyEngine.java:64: cannot access java.beans.PropertyChangeListener [javac] class file for java.beans.PropertyChangeListener not found [javac] public class JRubyEngine extends BSFEngineImpl { [javac] ^ [javac] /nas/projects/cameron/public/android_sdk_linux_m3-rc20a/JRubyTest/src/org/jruby/javasupport/JavaClass.java:969: cannot find symbol [javac] symbol : class BeanInfo [javac] location: class org.jruby.javasupport.JavaClass [javac] BeanInfo info; [javac] ^ [javac] /nas/projects/cameron/public/android_sdk_linux_m3-rc20a/JRubyTest/src/org/jruby/javasupport/JavaClass.java:972: cannot find symbol [javac] symbol : variable Introspector [javac] location: class org.jruby.javasupport.JavaClass [javac] info = Introspector.getBeanInfo(javaClass()); [javac] ^ [javac] /nas/projects/cameron/public/android_sdk_linux_m3-rc20a/JRubyTest/src/org/jruby/javasupport/JavaClass.java:973: cannot find symbol [javac] symbol : class IntrospectionException [javac] location: class org.jruby.javasupport.JavaClass [javac] } catch (IntrospectionException e) { [javac] ^ [javac] /nas/projects/cameron/public/android_sdk_linux_m3-rc20a/JRubyTest/src/org/jruby/javasupport/JavaClass.java:977: cannot find symbol [javac] symbol : class PropertyDescriptor [javac] location: class org.jruby.javasupport.JavaClass [javac] PropertyDescriptor[] descriptors = info.getPropertyDescriptors(); [javac] ^ [javac] /nas/projects/cameron/public/android_sdk_linux_m3-rc20a/JRubyTest/src/org/jvyamlb/RepresenterImpl.java:393: warning: non-varargs call of varargs method with inexact argument type for last parameter; [javac] cast to java.lang.Object for a varargs call [javac] cast to java.lang.Object[] for a non-varargs call and to suppress this warning [javac] values.put(pname, ems[i].invoke(data,null)); [javac] ^ [javac] /nas/projects/cameron/public/android_sdk_linux_m3-rc20a/JRubyTest/src/org/jruby/javasupport/bsf/JRubyEngine.java:130: cannot find symbol [javac] symbol : variable super [javac] location: class org.jruby.javasupport.bsf.JRubyEngine [javac] super.initialize(manager, language, someDeclaredBeans); [javac] ^ [javac] /nas/projects/cameron/public/android_sdk_linux_m3-rc20a/JRubyTest/src/org/jruby/javasupport/bsf/JRubyEngine.java:141: cannot find symbol [javac] symbol : variable this [javac] location: class org.jruby.javasupport.bsf.JRubyEngine [javac] runtime.getGlobalVariables().defineReadonly("$bsf", new FunctionsGlobalVariable(runtime, new BSFFunctions(manager, this))); [javac] ^ [javac] /nas/projects/cameron/public/android_sdk_linux_m3-rc20a/JRubyTest/src/org/jruby/javasupport/bsf/JRubyEngine.java:234: cannot find symbol [javac] symbol : variable super [javac] location: class org.jruby.javasupport.bsf.JRubyEngine [javac] super.terminate(); [javac] ^ [javac] Note: Some input files use unchecked or unsafe operations. [javac] Note: Recompile with -Xlint:unchecked for details. [javac] 12 errors [javac] 1 warning BUILD FAILED Oh, this was JRuby-1.0.2 in both cases.