sbool javaXStandalone_init_runArbitraryPrograms = true; // returns true if you should exit // idempotent sbool javaXStandalone_init(S[] args, O... _) { if (javax() != null) false; getJavaXDirectly((Runnable) optPar beforeInit(_)); // forward to JavaX if arguments start with a program ID if (javaXStandalone_init_runArbitraryPrograms && isInteger(first(args))) ret true with call(javax(), 'goMain, new O[] {args}); call(javax(), 'initHelloMessage); // TODO: fix security (user check) call(javax(), 'loadMyClasses); // for when jar file is modified while program is running callOnLoadMethods(mc()); call(javax(), 'redirectSystemOutAndErr); // always make console to get the log, show it optionally setOpt(javax(), consoleOn := !boolPar noConsole(_)); call(javax(), 'tryToOpenConsole, args); print("javax=" + javax() + ", console=" + getOpt(javax(), 'console)); false; }