Table of Content
ftp jython-2.1.class to server
install without GUI
java jython_21 -o /home/dev/jython demo lib source
add path to $HOME/.cshrc
setenv PATH ${PATH}:/home/dev/jython setenv CLASSPATH .:/home/dev/jython/jython.jar
first time run jython
*sys-package-mgr*: processing new jar, '/home/dev/jython/jython.jar' *sys-package-mgr*: processing new jar, '/usr/j2se/jre/lib/rt.jar' *sys-package-mgr*: processing new jar, '/usr/j2se/jre/lib/sunrsasign.jar' *sys-package-mgr*: processing new jar, '/usr/j2se/jre/lib/jsse.jar' *sys-package-mgr*: processing new jar, '/usr/j2se/jre/lib/jce.jar' *sys-package-mgr*: processing new jar, '/usr/j2se/jre/lib/charsets.jar' *sys-package-mgr*: processing new jar, '/usr/j2se/jre/lib/ext/dnsns.jar' *sys-package-mgr*: processing new jar, '/usr/j2se/jre/lib/ext/ldapsec.jar' *sys-package-mgr*: processing new jar, '/usr/j2se/jre/lib/ext/localedata.jar' *sys-package-mgr*: processing new jar, '/usr/j2se/jre/lib/ext/sunjce_provider.jar' *sys-package-mgr*: processing new jar, '/usr/j2se/jre/lib/ext/jhall.jar' *sys-package-mgr*: processing new jar, '/usr/j2se/jre/lib/ext/iiimf.jar' Jython 2.1 on java1.4.2_05 (JIT: null) Type “copyright”, “credits” or “license” for more information. >>> 1+2 3 >>> import sys;sys.exit(0);
compile jython to java class
user@host> more hello.py #!/usr/bin/python print 'The Bright Side of Life…' # another comment here $jythonc hello.py processing hello Required packages: Creating adapters: Creating .java files: hello module Compiling .java to .class… Compiling with args: ['/usr/j2se/bin/javac', '-classpath', '/home/dev/pkg/../jython/jython.jar:.:/home/dev/jython/jython.jar :./jpywork::/home/dev/pkg/../jython/Tools/jythonc:/home/dev/python/.: /home/dev/pkg/../jython/Lib', './jpywork/hello.java'] user@host> pwd /home/dev/python user@host> cd jpywork/ user@host> java hello The Bright Side of Life…