This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: eval on Android
- From: Per Bothner <per at bothner dot com>
- To: Helmut Eller <eller dot helmut at gmail dot com>
- Cc: kawa at sources dot redhat dot com
- Date: Fri, 06 Jan 2012 12:07:35 -0800
- Subject: Re: eval on Android
- References: <m2hb08vcxx.fsf@gmail.com>
On 01/06/2012 11:38 AM, Helmut Eller wrote:
Is eval supposed to work on Android?
Yes and no. Normally, eval compiles to bytecode and then does a
definedClass. This doesn't work on Dalvik.
The "fix" is to change compilerAvailable in ModuleExp.java to false.
We should change compilerAvailable to a static method like:
static int compilerAvailableChecked;
public static boolean checkCompilerAvailable() {
if (compilerAvailableChecked != 0)
return compilerAvailableChecked > 0;
... run a test to see if compiler is available ...;
}
Note the compiler may be unavailable for multiple reasons, not
just that ClassLoader.defineClass doesn't work (on Android),
but also if we're using kawart.jar instead of kawa.jar.
But in the short term something that sets compilerAvailable
properlywhen running under Android is the highest priority.
I'm trying to start a REPL on a socket but I always get
NullPointerExceptions during eval.
....
java.lang.NullPointerException
at kawa.lang.Eval.evalBody(Eval.java:74)
Hm. This looks like language == null, assuming the same line
numbers as I have. I.e. Language.getDefaultLanguage()
returned null. I haven't looked at this code in a while,
so I don't remember how it's supposed to work.
--
--Per Bothner
per@bothner.com http://per.bothner.com/