From: Brian Z. <bri...@ya...> - 2001-08-23 22:17:09
|
I know jython works with MS jview, how does it solve the boot.class.path? Below is the related-conversation in ibm.software.vame. -Brian "Patrick Mueller" <pat...@ot...> wrote in message news:9m3r1e$rug$1...@ne...... > Our classes.zip needs to be on the -bp. Don't bother putting it on the -cp. > Our jclMax is only 3M unzipped, is jython really 6M? Also, our classes.zip > file is not compressed. I believe it actually works compressed as well, at > least on most OSes. > > wrt: "import java", perhaps the jython code is sniffing our JCL looking for > some Sun thing, and then getting confused. What does it do on a Win32 box? > > -- > ---------------------------------------------------- > Pat...@ot... > ---------------------------------------------------- > You are right, jclMax is about 3M, jython is 6M. A quick grep in jython source reveals: > private void findAllPackages(Properties registry) { > String paths = registry.getProperty( > "python.packages.paths", > "java.class.path,sun.boot.class.path"); > ... Is there an equivalent property in OTI VM to let others know about its bootclass.path? -Brian > > "Brian Zhou" <bri...@te...> wrote in message > news:9m3fc3$22ic$1...@ne...... > > Hi all, > > > > About two months ago I experimented with jython on WinCE/iPaq and had some > > success, now VAME (IBM visual age micro edition) has released 1.4 (== > 1.3.0 > > jvm), so I tried the new version. > > > > Good news is I don't have to copy Sun's rt.jar, and pystone shows an > > improvement from 48 to 52. But adding \vame1.4\lib\jclMax\classes.zip to > the > > classpath option does not work, I have to work around by using a 9M > > extracted .class tree. > > > > Here's the updated instruction: > > > > 1. download from http://www.embedded.oti.com/ "runtime for ARM PocketPC" > and > > "custom config" > > 2. install the runtime, extract the zip file and copy to pocketpc under > > \vame1.4 > > 3. install the "custom config", copy lib\jclMax to pocketpc \vame1.4\lib > > 4. download jython2.1a3 from http://www.jython.org , copy \jython-2.1a3 to > > pocketpc \jython-2.1a3 > > 5. extract lib\jclMax\classes.zip and copy all subdir/files to pocketpc > > \vame1.4\lib\classes > > 6. create a shortcut RunJython.lnk using the following 4 lines concated > (on > > a single line seperated by " ") on your desktop PC and copy it to your > > pocketpc (-cp:classpath, -bp:bootstrap): > > 132#"\vame1.4\j9.exe" > > "-bp:\vame1.4\lib\jclMax\classes.zip" > > "-cp:\vame1.4\lib\classes;\jython-2.1a3\jython.jar" > > "org.python.util.jython" > > > > Here's the part I hope someone can give me some insight, I want to know > why > > classes.zip cannot be in classpath: > > > > 1. If I leave the classpath as "-cp:\jython-2.1a3\jython.jar", I can > launch > > jython fine, do all the python stuff, while "import java" shows "no module > > named java" > > 2. If I use > "-cp:\vame1.4\lib\jclMax\classes.zip;\jython-2.1a3\jython.jar", > > I got error message: > > *sys-package-mgr*: processing new jar, '\vame1.4\lib\jclMax\classes.zip' > > java.lang.IndexOutOfBoundsException > > > > Stack trace: > > java/lang/Throwable.<init>()V > > java/lang/Throwable.<init>(Ljava/lang/String;)V > > java/lang/IndexOutOfBoundsException.<init>(Ljava/lang/String;)V > > java/util/zip/ZipInputStream.read([BII)I > > java/util/zip/ZipInputStream.skip(J)J > > java/io/DataInputStream.skipBytes(I)I > > org/python/core/PackageManager.checkAccess(Ljava/io/InputStream;)I > > > > > org/python/core/CachedJarsPackageManager.addZipEntry(Ljava/util/Hashtable;Lj > > ava/util/zip/ZipEntry;Ljava/util/zip/ZipInputStream;)V > > > > > org/python/core/CachedJarsPackageManager.getZipPackages(Ljava/io/InputStream > > ;)Ljava/util/Hashtable; > > > > > org/python/core/CachedJarsPackageManager.addJarToPackages(Ljava/net/URL;Ljav > > a/io/File;Z)V > > > > > org/python/core/CachedJarsPackageManager.addJarToPackages(Ljava/io/File;Z)V > > org/python/core/PathPackageManager.addClassPath(Ljava/lang/String;)V > > > > org/python/core/SysPackageManager.findAllPackages(Ljava/util/Properties;)V > > > > > org/python/core/SysPackageManager.<init>(Ljava/io/File;Ljava/util/Properties > > ;)V > > org/python/core/PySystemState.initPackages(Ljava/util/Properties;)V > > > > > org/python/core/PySystemState.initialize(Ljava/util/Properties;Ljava/util/Pr > > operties;[Ljava/lang/String;Ljava/lang/ClassLoader;)V > > > > > org/python/core/PySystemState.initialize(Ljava/util/Properties;Ljava/util/Pr > > operties;[Ljava/lang/String;)V > > org/python/util/jython.main([Ljava/lang/String;)V > > > > 3. As mentioned, extract classes.zip to directory and add directory to -cp > > works fine. > > 4. I also tried to jar classes/ directory into a classes.jar but that > caused > > jython to complain "skip bad jar" > > > > Anyone has any idea the cause, or what to do further? I mean it works ok > > right now, except I have to live with this 9M .class tree on a handheld. > > > > Thanks for any help or suggestions, > > > > -Brian > > > > > > > > > > |
From: <bc...@wo...> - 2001-08-24 18:44:11
|
[Brian Zhou] >I know jython works with MS jview, how does it solve the boot.class.path? It requires that clspack -auto have been run. That places all classes in a classes.zip file that is available on the "java.class.path" system property: Jython 2.1a3 on java1.1.4 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> import java >>> for p in java.lang.System.getProperty("java.class.path").split(";"): ... print p ... C:\WINNT\java\trustlib\ C:\WINNT\java\classes\classes.zip C:\WINNT\java\classes\ D:\jython\jython-2.1a3-jview\ regards, finn |