javasci.Scilab (deprecated) Javasci v1 (deprecated) javasci FAQ

Manuel Scilab >> Interface avec Java > Javasci v1 (deprecated) > Compile and run with javasci v1

Compile and run with javasci v1

How to compile a Java application using Javasci v1. Deprecated: Please use Javasci v2

Description

To compile a Java code based on Javasci, it is only necessary to have javasci.jar defined in the classpath.

For example, with the code defined in the example of this page, the command would be:

on Linux/Unix/MacOSX:

$ javac -cp $SCI/modules/javasci/jar/javasci.jar BasicExample.java

on Windows:

D:\> javac -cp %SCI%\modules\javasci\jar\javasci.jar BasicExample.java

To run Scilab, there are a few other things to set up.

Some global variables must me set:

To launch the Java Application, you can either provide them with environnement variable

optional options to launch java : -Djava.compiler=JIT -Xmx256m

(With these arguments , you launch javasci with same initial options that standard scilab).

Note that two environnement variables are taken in account for specific needs:

Examples

// A simple Java example 
// Filename: BasicExample.java

import javasci.Scilab;

public class BasicExample {
    public static void main(String []args){
    Scilab.Exec("disp((%pi^2)/6);");
    }
}

See Also

Authors

Allan Cornet

Sylvestre Ledru

javasci.Scilab (deprecated) Javasci v1 (deprecated) javasci FAQ