This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: eval on Android


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]