From: Jeff E. <jem...@fr...> - 2007-03-28 15:33:06
|
If you put Lib in a jar, then you need to make sure sys.path includes path_to_jar/Lib, probably by setting the Java system property python.path since you won't have a jython registry file. Michael Litherland wrote: > Hi, > > I've searched the documentation and the list archives as well as I could > and > though I've seen somewhat similar queries I haven't found any solutions > yet. > > I'm developing a Java application that needs to be easily distributable and > doesn't require anything installed on the host system except Java 1.5 or > newer. The Jython interpreter is embedded and used to validate and test > Jython code that the user can enter through the swing interface. It works > great right up until the user tries something like: > > import string > import re > #... > > Of course the issue is that when Jython is installed it know where the Lib > directory is, but installing the Jython distribution on any of the host > machines is not an option (in fact this app will almost certainly only be > able to run as an applet or webstart). > > I've tried tricks like jarring up the Lib/ directory and adding it to the > classpath which I should have guessed won't automagically work. In the > Jython API the PathPackageManager looks promising, but I admit that I can't > figure out how it ties into the interpreter. It also appears that > python.path can help me out, but I don't think that just including the Lib > dir and all those files is a very good solution (maybe not even possible > with webstart and applet). > > I don't mind interrogating a jar file containing all of the necessary > source > and fiddling with JarEntries and that fun stuff if there's a way that I can > get access to the Jython standard imports in a Jar file. I'm just hoping > someone's either done it before or can point me in the right direction in > the API docs. It seems to me, also, that being able to distribute the Lib > stuff in a jar would make a lot of people's lives easier. > > Thanks, > Mike > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > > ------------------------------------------------------------------------ > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users |