Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: English - Français - Português - 日本語 -
Справка Scilab >> Java Interface > javasci


Call Scilab engine from a Java application


Scilab offers the possibility to be called from a Java application.

This help describes the features of the javasci API.

Since Scilab version 5.3.0, a new version of Javasci called Javasci v2 has been introduced. This version fixes most of the limitations of Javasci v1.

Browse the documentation of Javasci v2. (this will open the web browser).

Example of Javasci v2

// A simple Java example with javasci v2
// Filename:

import org.scilab.modules.javasci.Scilab;
import org.scilab.modules.types.ScilabType;
import org.scilab.modules.types.ScilabDouble;

class Example1 {

    public static void main(String[] args) {

      try {
            Scilab sci = new Scilab();

            ScilabDouble a = new ScilabDouble(3.14);
            ScilabType b = sci.get("b");
            System.out.println("b = " + b);


      } catch (org.scilab.modules.javasci.JavasciException e) {
            System.err.println("An exception occurred: " + e.getLocalizedMessage());


See also


5.4.0 Javasci v1 is removed.
5.4.0 New methods added:
  • Scilab.execException(String)

    Same as Scilab.exec(String) but returns an exception when a Scilab error occurs

  • Scilab.execException(String[])

    Same as Scilab.exec(String[]) but returns an exception when a Scilab error occurs

  • Scilab.execException(File)

    Same as Scilab.exec(File) but returns an exception when a Scilab error occurs

  • Javasci supports sparse and boolean sparse datatypes.
  • Javasci supports tlists, mlists and lists datatypes.
  • Javasci supports polynomial datatypes.
  • Javasci supports struct datatypes under the form of an mList.
Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Mon Jan 03 14:40:13 CET 2022