Scilab 5.5.1
- Ajuda do Scilab
- Java from Scilab
- Getting started - Beginning
- Getting started - Second step
- jallowClassReloading
- jarray
- jautoTranspose
- jautoUnwrap
- jcast
- jcompile
- jconvMatrixMethod
- jcreatejar
- jdeff
- jdisableTrace
- jenableTrace
- jexists
- jgetclassname
- jgetfield
- jgetfields
- jgetinfo
- jgetmethods
- jimport
- jinvoke
- jinvoke_db
- jnewInstance
- jnull
- jremove
- jsetfield
- junwrap
- junwraprem
- jvoid
- jwrap
- jwrapinchar
- jwrapinfloat
- new
Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function
jcompile
Compile Java code or file
Calling Sequence
class = jcompile(className, code); class = jcompile(javaFiles);
Parameters
- className
A string giving the class name
- code
A row or a column of strings containing the Java code.
- javaFiles
Path to Java files.
- class
A mlist typed _JClass
Description
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.
Examples
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"))
See Also
- jimport — Import a Java class
History
Versão | Descrição |
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. |
Report an issue | ||
<< jcast | Java from Scilab | jconvMatrixMethod >> |