Use Jython to make true executable?
rcl211 at see.sig
Sat Jun 9 00:43:42 EDT 2001
> This request comes from people who don't know that having a .py file
> (or .pyw) is just as good as having a .exe file. In fact, having a
> .py is better because it will work with newer (better) interpreters
I have to agree. If you want to offer a compiled version built throught
the method proposed, you'd have to distrubute libgcj and friends on the
user's PC anyway. Why not just install Python?
> GCC (gcj, rather) can compile Java _source_ to native code (C++ object
> files) that ld links together with libgcj (Sun's jdk calls it "rt.jar"
Actually, GCJ can compile Java's .class files (in addition to Java source)
into native code. In theory, a Python source ->(Jython)-> Java bytecode
->(GJC)-> native executable could work. Assuming you manage to get the
Jython runtime library compiled, which might not be possible with the
current state of libgcj (I don't know for sure, but I'd wager against it).
Note that libgcj also includes a bytecode interpreter so even if you can't
compile a .class file into native code for some reason, you can always run
it interpretively. I don't know if this would allow you to use Sun's
(bytecode) rt.jar with your own compiled program to make up for whats
lacking in libgcj, but it might.
> If you have the source, then go right ahead. I don't think libgcj
> implements the AWT yet, though, and I know Kaffe doesn't (a free, open
> source JVM). OTOH there is PJA (Pure Java AWT) that can be used
> instead (it is most useful for headless servlets, etc).
While libgcj doesn't (currently) have AWT support, Kaffe does. It uses
Biss-AWT (http://www.biss-net.com/biss-awt.html), an AWT implementation for
X11. See http://www.transvirtual.com/kaffe-awt.htm for more information.
Rob Linwood -- rcl211 at nyu dot edu
More information about the Python-list