Compile Java code or file
class = jcompile(className, code); class = jcompile(javaFiles);
A string giving the class name
A row or a column of strings containing the Java code.
Path to Java files.
A mlist typed _JClass
Compile Java source code and load the corresponding class. If the package tools.jar distributed with JDK is not in the classpath, the Eclipse Compiler for Java (ECJ) will be used.
If the argument is a file, jcompile will compile the Java code.
![]() | *.class files generated by the compilation are stored in the TMPDIR/JIMS/bin
directory. |
hw = jcompile("HelloWorld", ["public class HelloWorld {" "public static String getHello() {" "return ""Hello World !!"";" "}" "}"]); hello = hw.getHello() jremove hello hw | ![]() | ![]() |
fd = mopen(TMPDIR+'/HelloWorld.java','wt'); mputl(["public class HelloWorld {" "public static String getHello() {" "return ""Hello World !!"";" "}" "}"],fd); mclose(fd); jcompile(TMPDIR+"/HelloWorld.java") | ![]() | ![]() |
directory=SCI+"/modules/external_objects_java/examples/com/foo/"; // Compile of all them jcompile(ls(directory + "/*.java")) | ![]() | ![]() |
Version | Description |
5.5.0 | Function introduced. Based on the 'JIMS' module. The main difference in the behavior compared to the JIMS module is that jautoUnwrap is enabled by default. |