Hello foks,
.. firs of all i have to express my thanks to all developers of jython,
good work.
i have a question about compiling modules with jythonc, can you help me,
or give me a notice if i'm wrong. I've small necessity to run my
application as binary jar rather than interactive script.
(reason: i dont want to allow users to change the code.)
(i would be happy to have at the and an .exe or .jar file.)
I have wrote a program which uses SWT + Jython + JDBC. With UI fully
created in Eclipse Visual Editor.
So everything works fine with jython2.2a1 in interactive mode. But i
need some binnary form, without 'changeable sources'.
My application structrure look like this:
MyAPP/
lib/
*jdbc*.jar
swt*.jar
simpleUI.jar --> buildded in Eclipse VE
uiModule/
__init__.py
simpleInterface.py --> this loads the simpleUI.jar overload some
methods and run full UI
dbModule/
__init__.py
dbTools.py --> this is my wrapper to db access
anLogger.py --> simple logger
myApp.py --> main code which loads and starts UI from
simpleInterface.py and which handle all UI events.
- How should i compile this with jythonc ?
- Is it today good idea to compile that with jythonc, assuming that
jythonc is bit out dated.
Other 'ugly' ways:
Is it posible run whole program, then clean up directory from *.py files
so all .class and .py$class files will remain and application will be
runnable on other machines?
The problems i have now with jythonc:
(i'm not much skilled with java, so may be i have just something
overlooked. Give me a bunch in that case...)
compilation 1:
CLASSPATH=`simpleUI.jar .....` #simplified
jythonc -c -d -jar myApp.jar myApp.py myLogger.py
dbModule/dbtools.py uiModule/simpleInterface.py
if there is no SWT jar in the classpatth compilation finish (just with
deprecated API warnings), but i'm unable tu run final myApp.jar later
like this:
java -cp SWT.jar -jar myApp.jar # this will fail because
'eclipse' --> org.eclipse.swt is not in classpath.
why ? how-to, i have swt.jar in CP or not ?
compilation 2:
the same but with SWT.jar in classpath. compilation fails, for
deprecated API.
So i've tried to change JRE to 1.3 (latest to work with jythonc), but
still the same..
As you can see I'm bit confused with that compilation. Can you give me a
recomendation how to do that stuff. Thanks.
If you would like:
I can write short wiki howto - writing simple applications using
Eclipse VE /SWT + jython.
Write a more complex example about compilation of jython classes
with jythonc.
Thans for your time, Petr.
|