<?xml version="1.0" encoding="UTF-8"?>

<!--
*
* Scilab ( https://www.scilab.org/ ) - This file is part of Scilab
* Copyright (C) 2010 - 2011 - Calixte DENIZET <calixte@contrib.scilab.org>
*
 * Copyright (C) 2012 - 2016 - Scilab Enterprises
 *
 * This file is hereby licensed under the terms of the GNU GPL v2.0,
 * pursuant to article 5.3.4 of the CeCILL v.2.1.
 * This file was originally licensed under the terms of the CeCILL v2.1,
 * and continues to be available under such terms.
 * For more information, see the COPYING file which you should have received
 * along with this program.
*
*
-->

<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="ja" xml:id="jcompile">

    <refnamediv>

        <refname>jcompile</refname>

        <refpurpose>Javaコードまたはファイルをコンパイルする</refpurpose>

    </refnamediv>

    <refsynopsisdiv>

        <title>呼び出し手順</title>

        <synopsis>

            class = jcompile(className, code);

            class = jcompile(javaFiles);

        </synopsis>

    </refsynopsisdiv>

    <refsection>

        <title>パラメータ</title>

        <variablelist>

            <varlistentry>

                <term>className</term>

                <listitem>

                    <para>クラス名を指定する文字列</para>

                </listitem>

            </varlistentry>

            <varlistentry>

                <term>code</term>

                <listitem>

                    <para>

                        Javaコードを有する文字列の行または列

                    </para>

                </listitem>

            </varlistentry>

            <varlistentry>

                <term>javaFiles</term>

                <listitem>

                    <para>Javaファイルのパス.</para>

                </listitem>

            </varlistentry>

            <varlistentry>

                <term>class</term>

                <listitem>

                    <para>_JClass型のmlist</para>

                </listitem>

            </varlistentry>

        </variablelist>

    </refsection>

    <refsection>

        <title>説明</title>

        <para>

            Javaソースコードをコンパイルし, 対応するクラスを読み込みます.

            JDKで配布されるパッケージ tools.jar が classpath に存在しない場合,

            Eclipse Compiler for Java (ECJ) が使用されます.

        </para>

        <para>

            引数がファイルの場合, jcompile はJavaコードをコンパイルします.

        </para>
        <note>
            *.class files generated by the compilation are stored in the TMPDIR/JIMS/bin
            directory.
        </note>

    </refsection>

    <refsection>

        <title>例</title>

        <programlisting role="example"><![CDATA[
               hw = jcompile("HelloWorld", ["public class HelloWorld {"
                                            "public static String getHello() {"
                                            "return ""Hello World !!"";"
                                            "}"
                                            "}"]);

               hello = hw.getHello()

               jremove hello hw
      ]]></programlisting>

        <programlisting role="example"><![CDATA[
fd = mopen(TMPDIR+'/HelloWorld.java','wt');
mputl(["public class HelloWorld {"
                   "public static String getHello() {"
                   "return ""Hello World !!"";"
                   "}"
                   "}"],fd);
mclose(fd);

jcompile(TMPDIR+"/HelloWorld.java")
      ]]></programlisting>

        <programlisting role="example"><![CDATA[
directory=SCI+"/modules/external_objects_java/examples/com/foo/";
// Compile of all them
jcompile(ls(directory + "/*.java"))
      ]]></programlisting>

    </refsection>

    <refsection role="see also">

        <title>参照</title>

        <simplelist type="inline">
            <member>
                <link linkend="jimport">jimport</link>
            </member>
            <member>
                <link linkend="jallowClassReloading">jallowClassReloading</link>
            </member>
            <member>
                <link linkend="jdeff">jdeff</link>
            </member>
            <member>
                <link linkend="javasci">javasci</link>
            </member>
            <member>
                <link linkend="compile_and_run_javasci_v2">javasci v2</link>
            </member>
            <member>
                <link linkend="javaclasspath">javaclasspath</link>
            </member>
        </simplelist>

    </refsection>

    <refsection>

        <title>履歴</title>

        <revhistory>

            <revision>

                <revnumber>5.5.0</revnumber>

                <revremark>

                    関数が導入されました. 'JIMS'モジュールに基づきます.

                    JIMSモジュールとの動作上の主な違いは,

                    <link linkend="jautoUnwrap">jautoUnwrap</link>がデフォルトで

                    有効になっていることです.

                </revremark>

            </revision>

        </revhistory>

    </refsection>

</refentry>



