51a1e0050acab3da4d2a1bff79a6d5fa54e04c6a
[scilab.git] / scilab / modules / external_objects_java / help / en_US / jcompile.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3 *
4 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
5 * Copyright (C) 2010 - 2011 - Calixte DENIZET <calixte@contrib.scilab.org>
6 *
7  * Copyright (C) 2012 - 2016 - Scilab Enterprises
8  *
9  * This file is hereby licensed under the terms of the GNU GPL v2.0,
10  * pursuant to article 5.3.4 of the CeCILL v.2.1.
11  * This file was originally licensed under the terms of the CeCILL v2.1,
12  * and continues to be available under such terms.
13  * For more information, see the COPYING file which you should have received
14  * along with this program.
15 *
16 *
17 -->
18 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:lang="en" xml:id="jcompile">
19     <refnamediv>
20         <refname>jcompile</refname>
21         <refpurpose>Compile Java code or file</refpurpose>
22     </refnamediv>
23     <refsynopsisdiv>
24         <title>Syntax</title>
25         <synopsis>
26             class = jcompile(className, code);
27             class = jcompile(javaFiles);
28         </synopsis>
29     </refsynopsisdiv>
30     <refsection>
31         <title>Parameters</title>
32         <variablelist>
33             <varlistentry>
34                 <term>className</term>
35                 <listitem>
36                     <para>A string giving the class name</para>
37                 </listitem>
38             </varlistentry>
39             <varlistentry>
40                 <term>code</term>
41                 <listitem>
42                     <para>A row or a column of strings containing the Java code.</para>
43                 </listitem>
44             </varlistentry>
45             <varlistentry>
46                 <term>javaFiles</term>
47                 <listitem>
48                     <para>Path to Java files.</para>
49                 </listitem>
50             </varlistentry>
51             <varlistentry>
52                 <term>class</term>
53                 <listitem>
54                     <para>A mlist typed _JClass</para>
55                 </listitem>
56             </varlistentry>
57         </variablelist>
58     </refsection>
59     <refsection>
60         <title>Description</title>
61         <para>
62             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.
63         </para>
64         <para>If the argument is a file, jcompile will compile the Java code.</para>
65     </refsection>
66     <refsection>
67         <title>Examples</title>
68         <programlisting role="example"><![CDATA[
69                hw = jcompile("HelloWorld", ["public class HelloWorld {"
70                                             "public static String getHello() {"
71                                             "return ""Hello World !!"";"
72                                             "}"
73                                             "}"]);
74
75                hello = hw.getHello()
76
77                jremove hello hw
78       ]]></programlisting>
79         <programlisting role="example"><![CDATA[
80 fd = mopen(TMPDIR+'/HelloWorld.java','wt');
81 mputl(["public class HelloWorld {"
82                    "public static String getHello() {"
83                    "return ""Hello World !!"";"
84                    "}"
85                    "}"],fd);
86 mclose(fd);
87
88 jcompile(TMPDIR+"/HelloWorld.java")
89       ]]></programlisting>
90         <programlisting role="example"><![CDATA[
91 directory=SCI+"/modules/external_objects_java/examples/com/foo/";
92 // Compile of all them
93 jcompile(ls(directory + "/*.java"))
94       ]]></programlisting>
95     </refsection>
96     <refsection role="see also">
97         <title>See also</title>
98         <simplelist type="inline">
99             <member>
100                 <link linkend="jimport">jimport</link>
101             </member>
102         </simplelist>
103     </refsection>
104     <refsection>
105         <title>History</title>
106         <revhistory>
107             <revision>
108                 <revnumber>5.5.0</revnumber>
109                 <revremark>
110                     Function introduced. Based on the 'JIMS' module. The main difference in the behavior compared to the JIMS module is that <link linkend="jautoUnwrap">jautoUnwrap</link> is enabled by default.
111                 </revremark>
112             </revision>
113         </revhistory>
114     </refsection>
115 </refentry>
116