Error when invoking method - java.lang.RuntimeException: Uncompilable source code - Erroneous tree type: <any> -


i've been working on project described in this question asked previously. i'm trying invoke method class who's name dynamically generated (and class compiled while program runs). call class watchface = class.forname("pebbleos.pebbleos_" + filename); followed currentwatchface = watchface.newinstance(); in method loadwatchface(), , in method runwatchface() try invoke method using this:

method method = null;         try {             method = currentwatchface.getclass().getmethod("initializeface");         } catch (securityexception | nosuchmethodexception e) {             system.out.println("error");         }         method.invoke(currentwatchface); 

my watch face's code being taken text file, looks this:

package pebbleos;  public class pebbleos_default {      public pebbleos_default () {      }      public void initializeface() {         system.out.println(“hello world”);     }  } 

just quick note, above supposedly "cause" of error: java.lang.reflect.invocationtargetexception

from code posted, seems you're using wrong character looks lot " they're not same. fix it, recompile code , try again.


Comments

Popular posts from this blog

symfony - TEST environment only: The database schema is not in sync with the current mapping file -

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -