From: mathog@seqaxp.bio.caltech.edu Sent: Monday, July 24, 2000 12:41 PM To: Info-VAX@Mvb.Saic.Com Subject: Re: run java out of jar files, vs jar -xf In article <8lgvff$r1m@newton.cc.rl.ac.uk>, "Richard Brodie" writes: > >"David Mathog" wrote in message >news:8la77v$c0m@gap.cco.caltech.edu... >> Is there a way to run programs on VMS using the "java" command without >> first having to jar -xf all the jar files that comprise it? > >A construction like: > >java -classpath 'f$trnlnm("CLASSPATH")':/app_dir/app.jar Class > Ok, I see the solution - sort of. There are 5 .jar files packed up into one .zip file. Nothing I tried let me run out of that .zip file directly - I guess it must hold .class files rather than .jar files for that to work. So I unpacked that .zip file into a directory, did: $ @sys$manager:java$setup.com $ define classpath "/sys$common/java/lib/JDK118_CLASSES.ZIP:.:CFG2CMD.JAR:EPS.JAR:EZWEBCON.JAR:JAVAMAN.JAR:SIMPLET.JAR" $ java "EZWebCon" and it worked. However, these two forms did not work: $ define classpath "/sys$common/java/lib/JDK118_CLASSES.ZIP:.:*.jar" $ define classpath "/sys$common/java/lib/JDK118_CLASSES.ZIP:." So it looks like you have to define all .jar files explicitly in the classpath - there's no way to indicate "all .jar in this directory". Hmm, let's see if I can repack this into a functional .zip. This is on an ODS2 disk: $ jar -xf CFG2CMD.JAR $ jar -xf EPS.JAR $ jar -xf EZWEBCON.JAR $ jar -xf JAVAMAN.JAR $ jar -xf SIMPLET.JAR $ zip/exclude=(*.jar,aaawherefrom.txt,test.zip) test.zip [...]*.* $ define classpath "/sys$common/java/lib/JDK118_CLASSES.ZIP:.:test.zip" $ java "EZWebCon" Hey, it worked! Oops, no it didn't - if I delete the .jar etc. files it doesn't work any more. Be nice if the java program knew how to open .jar files stored inside .zip files. Anyway, better to only have to unpack to 5 files rather than to 500. (By the way, EZWebCon is the program you use to upgrade the network cards on Genicom and Compaq LN* printers.) Thanks, David Mathog mathog@seqaxp.bio.caltech.edu Manager, sequence analysis facility, biology division, Caltech