From: chuck c. <cc...@zi...> - 2002-03-14 05:06:37
|
If you write a simple jython script and play with jythonc a little bit I think you'll come to understand the various options pretty quickly. I started using jythonc today for the first time and with a little experiementation I had it doing everything I wanted. To start with create a simple jython script. jythonc MyPy.py This will create a java file in the jpywork directory and will also compi= le it to a class file. This will just process the module that you pass in. jythonc -c MyPy.py This becomes helpful if you write jython that makes use of the .py module= s found in the Lib directory of your jython install. For instance, if you import and use the cPickle module you'll notice that when jythonc says it= is creating a .java file you'll see MyPy module as well as copy_reg module. This is because cPickle imports copy_reg. So in this way you can build everything in the core library to java so you won't need the have your python.home variable set and have all of thos files in Lib. jython -c -j MyJar.jar MyPy.py This will compile all the files you need into one nice and tidy jar file = and you can then execute your code using java -jar MyJar.jar if you are importing lots of java files you have written in com.company.project.subsystem.* then you can add these pacakages using the -A option. You can include multiple packages using a comma separated list. Try it out. I'm sure just these couple of commands will get you pretty f= ar. One minor cosmetic bug in jythonc.... If you type jythonc the Usage message was never updated during the migrat= ion from jpython -- it still says jpythonc chuck ----- Original Message ----- From: "TigerWraith" <tig...@ks...> To: <jyt...@li...> Sent: Wednesday, March 13, 2002 10:16 PM Subject: RE: [Jython-users] Help please! > Ok I'm using win2K Pro how in do I get it to compile can anyone please tell > me how. The examples aren't very good references for me. > > -----Original Message----- > From: jyt...@li... > [mailto:jyt...@li...]On Behalf Of Gerhard > H=E4ring > Sent: Wednesday, March 13, 2002 8:01 PM > To: jyt...@li... > Subject: Re: [Jython-users] Help please! > > > Le 13/03/02 ? 20:47, TigerWraith =E9crivit: > > Can jython compile python files into class files for java? > > Sure. jythonc does this. > > Gerhard > -- > mail: gerhard <at> bigfoot <dot> de registered Linux user #6423= 9 > web: http://www.cs.fhm.edu/~ifw00065/ OpenPGP public key id 86AB4= 3C0 > public key fingerprint: DEC1 1D02 5743 1159 CD20 A4B6 7B22 6575 86AB 4= 3C0 > reduce(lambda x,y:x+y,map(lambda > x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b'))) > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > > > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users |