From: Chambers, R. {D106~Indianapolis} <robert.chambers@ROCHE.COM> - 2004-04-30 19:24:33
|
Hello, I'm going through the tutorial at: https://www6.software.ibm.com/developerworks/education/j-jython1/j-jytho n1-4-7.html The example deals with compiling. Heres my output: C:\jython-2.1\ch1>jythonc factor.py processing factor Required packages: Creating adapters: Creating .java files: factor module Compiling .java to .class... Compiling with args: ['C:\\JBuilderX\\jdk1.4\\bin\\javac', '-classpath', 'C:\\jy thon-2.1\\jython.jar;;.\\jpywork;;C:\\jython-2.1\\Tools\\jythonc;C:\\jyt hon-2.1\ \ch1\\.;C:\\jython-2.1\\Lib;C:\\jython-2.1', '.\\jpywork\\factor.java'] 0 C:\jython-2.1\org\python\core\Py.java:989: warning: as of release 1.4, assert is a keyword, and may not be used as an identifier public static void assert(PyObject test, PyObject message) { ^ C:\jython-2.1\org\python\core\Py.java:995: warning: as of release 1.4, assert is a keyword, and may not be used as an identifier public static void assert(PyObject test) { ^ C:\jython-2.1\org\python\core\Py.java:996: warning: as of release 1.4, assert is a keyword, and may not be used as an identifier assert(test, Py.None); ^ Note: Some input files use or override a deprecated API. Note: Recompile with -deprecation for details. 3 warnings C:\jython-2.1\ch1> I checked my Java version: C:\jython-2.1\ch1>java -version java version "1.4.2_01" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_01-b06) Java HotSpot(TM) Client VM (build 1.4.2_01-b06, mixed mode) C:\jython-2.1\ch1> I'm guessing that this is a jython issue, is there a fix (Not wanting to downgrade my java) Thanks Robert Chambers rob...@ro... Indianapolis, Indiana 46250 |
From: Oti <oh...@ya...> - 2004-05-20 07:02:02
|
Hello Robert, using JDK 1.3 to compile would do no harm, and the resulting classes run fine under 1.4 if you really have to compile with JDK 1.4, the following changes are necessary: Py.java ------- change the name of the two static assert() methods to assert_() CodeCompiler.java ----------------- change the two following lines in method assert_stmt() from "org/python/core/Py", "assert", to "org/python/core/Py", "assert_", Then make sure that you delete all your $py.class files. I'm sorry to have no diff available, but the changes should be pretty straightforward. Please also note that this is solved in cvs HEAD. Best wishes, Oti. [Chambers, Robert ] > Hello, > > I'm going through the tutorial at: > https://www6.software.ibm.com/developerworks/education/j-jython1/j-jytho > n1-4-7.html > > The example deals with compiling. > Heres my output: > > C:\jython-2.1\ch1>jythonc factor.py > processing factor > > Required packages: > > Creating adapters: > > Creating .java files: > factor module > > Compiling .java to .class... > Compiling with args: ['C:\\JBuilderX\\jdk1.4\\bin\\javac', > '-classpath', > 'C:\\jy > thon-2.1\\jython.jar;;.\\jpywork;;C:\\jython-2.1\\Tools\\jythonc;C:\\jyt > hon-2.1\ > \ch1\\.;C:\\jython-2.1\\Lib;C:\\jython-2.1', > '.\\jpywork\\factor.java'] > 0 C:\jython-2.1\org\python\core\Py.java:989: warning: as of release > 1.4, assert > is a keyword, and may not be used as an identifier > public static void assert(PyObject test, PyObject message) { > ^ > C:\jython-2.1\org\python\core\Py.java:995: warning: as of release > 1.4, > assert is > a keyword, and may not be used as an identifier > public static void assert(PyObject test) { > ^ > C:\jython-2.1\org\python\core\Py.java:996: warning: as of release > 1.4, > assert is > a keyword, and may not be used as an identifier > assert(test, Py.None); > ^ > Note: Some input files use or override a deprecated API. > Note: Recompile with -deprecation for details. > 3 warnings > > C:\jython-2.1\ch1> > > I checked my Java version: > > C:\jython-2.1\ch1>java -version > java version "1.4.2_01" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_01-b06) > Java HotSpot(TM) Client VM (build 1.4.2_01-b06, mixed mode) > > C:\jython-2.1\ch1> > > I'm guessing that this is a jython issue, is there a fix (Not wanting > to > downgrade my java) |