Не компілює пітонові скрипти в javo-вий байт-код.
jython jtc-test.py
mark95
95,100
jythonc -A org.python.core.* -i -a -j module.jar jtc-test.py
processing jtc-test
Required packages:
java.lang
Creating adapters:
Creating .java files:
jtc-test module
Compiling .java to .class...
Compiling with args: ['/usr/bin/javac', '-classpath', '/usr/share/java/jython.jar:/usr/share/java/servlet-api-2.4.jar:/usr/share/java/libreadline-java.jar:./jpywork::/usr/share/jython/Tools/jythonc:/usr/share/jython/Lib:/usr/lib/site-python:__classpath__', './jpywork/jtc-test.java']
255 incorrect classpath: /usr/lib/site-python
incorrect classpath: __classpath__
----------
1. ERROR in ./jpywork/jtc-test.java (at line 3)
public class jtc-test extends java.lang.Object {
^^^
The public type jtc must be defined in its own file
----------
2. ERROR in ./jpywork/jtc-test.java (at line 3)
public class jtc-test extends java.lang.Object {
^^^^^
Syntax error on tokens, delete these tokens
----------
3. ERROR in ./jpywork/jtc-test.java (at line 130)
Py.runMain(jtc-test._PyInner.class, newargs, jtc-test.jpy$packages, jtc-test.jpy$mainProperties, "", new String[] {"jtc-test"});
^^^
jtc cannot be resolved
----------
4. ERROR in ./jpywork/jtc-test.java (at line 130)
Py.runMain(jtc-test._PyInner.class, newargs, jtc-test.jpy$packages, jtc-test.jpy$mainProperties, "", new String[] {"jtc-test"});
^^^^^^^^^^^^^
test._PyInner cannot be resolved to a type
----------
5. ERROR in ./jpywork/jtc-test.java (at line 130)
Py.runMain(jtc-test._PyInner.class, newargs, jtc-test.jpy$packages, jtc-test.jpy$mainProperties, "", new String[] {"jtc-test"});
^^^
jtc cannot be resolved
----------
6. ERROR in ./jpywork/jtc-test.java (at line 130)
Py.runMain(jtc-test._PyInner.class, newargs, jtc-test.jpy$packages, jtc-test.jpy$mainProperties, "", new String[] {"jtc-test"});
^^^^^^^^^^^^^^^^^
test.jpy$packages cannot be resolved to a type
----------
7. ERROR in ./jpywork/jtc-test.java (at line 130)
Py.runMain(jtc-test._PyInner.class, newargs, jtc-
ERROR DURING JAVA COMPILATION... EXITING
/usr/lib/site-python:__classpath__ - такого не існує, і взагалі що воно значить ?
Я пробував підмінити в /etc/jython/jython.conf
python.path = /usr/lib/python2.5
не допомагає.
jtc-test.py:
#!/usr/bin/env jython
import java
def exit(e): java.lang.System.exit(0)
mark = input ("mark")
#print "PrintSentence(mark)"
def PrintSentence (mark):
if mark in [27,29] :
print "\n27,29"
if mark in [45,50] :
print "\n45,5"
if mark in [67,68] :
print "\n67,68"
if mark in [89,90] :
print "\n89,90"
if mark in [95,100] :
print "\n95,100"
def run_function (function_name) :
function_name(mark)
run_function(PrintSentence)
#raw_input ("Press any key to exit")
а jython корисний не компілюванням в java байт-код python-ових скриптів, а використанням java класів в python ...