Search code examples
jythonbytecodejython-2.7

Is it possible to find just the java source from jython before a compiler turns it into bytecode?


It is my understanding that the jython compiler compiles the jython code into java source, and then compiles the java code into bytecode in either a $py.class file or a .class file (or I'm totally wrong and this is not how it works, but that doesn't really change the question.)

Is there a way for me to end up with a .java file with the resulting java source after I compile my program instead of ending up with a $py.class file or a .class file? If so, where would I then be able to find said file?


Solution

  • Aftern reading Jython and Java Integration it appears that this is no longer the case.

    Prior to Jython 2.5, the standard distribution of Jython included a utility known as jythonc. Its main purpose was to provide the ability to convert Python modules into Java classes so that Java applications could seamlessly make use of Python code, albeit in a roundabout fashion. jythonc actually compiles the Jython code down into Java .class files and then the classes are utilized within the Java application.

    [...]jythonc is no longer packaged with the Jython distribution beginning with the 2.5 release.