The IFS is case insensitive. This mean that capitalization does not matter
when you provide the full filename. It matters, however, if you need e.g.
QSH to expand wildcards. Here "*.java" is different from "*.JAVA" if
"A.java" is in the file system.
There is no wildcards in the RUNJVA command you list, so this is not the
cause.
Note however, that you provide a filename ending in .jar as the CLASS
argument. From the help of RUNJVA:
===
Class file or JAR file (CLASS) - Help
Specifies the class name or jar file to be run. The class
name may be qualified by one or more package names. Each
package name must be followed by a period. For example,
CLASS('pkg1.pkg2.myclass') identifies a class qualified by
two package names.
A jar file name may be specified only when running JDK 1.2
or higher. The start up class must be indicated by the
Main-Class in the manifest header.
class-name
Specify the name of the class to be run.
jar-name
Specify the name of the jar file with the Main-Class specified in
the manifest.
===
What is not crystal clear from that text is that providing a JAR-file
instead of a class-name to CLASS, mean that you want to run it with the
equivalent of "java -jar Balancer.jar" (i.e. an executable/runnable jar),
and in that mode the Classpath argument is _ignored_ (because it is
constructed from Class-Path entries in the manifest).
Instead just list the name of the class you want to use as the argument to
CLASS.
/Thorbjørn
-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Dan Kimmel
Sent: 31. januar 2013 02:56
To: Java Programming on and around the IBM i
Subject: RE: RUNJVA gives me class not found problem, while QSH command is
fine.
Check capitalization in all your paths. Running java from QSH, they'll all
be resolved without case sensitivity. I'm not so sure with RUNJVA. You're
getting messages from the J9 runtime which is most likely running in PASE
which will look for everything in QOpenSys which IS case sensitive. In fact,
it may be looking for /home in /QOpenSys/home.
I never use RUNJVA for all the spooky things it does that are a little hard
to anticipate. I run QSH with the CMD parameter as exactly the string you
have below the stack trace.
-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Kelly Beard
Sent: Wednesday, January 30, 2013 4:12 PM
To: java400-l@xxxxxxxxxxxx
Subject: RUNJVA gives me class not found problem, while QSH command is fine.
Getting a class not found error for a class that is clearly contained in a
.jar file (log4j-1.2.16.jar)
Offending CL command:
RUNJVA
CLASS(Balancer.jar)
PARM('--startcode' '99406' '--midnight' '--loglevel' 'debug'
'--limitsfile' 'DFCAVAILPT' '--logname'
'/home/dfcuser/Balancer_99406_QA_T.log')
CLASSPATH('.:/home/quikq/1.0/dev/log4j-1.2.16.jar:/QIBM/ProdData/OS400/jt400
/lib/jt400Native.jar:/QIBM/ProdData/Java400/ext/db2_classes.jar:/home/quikq/
1.0/dev/jargs.jar:/home/dfcuser/Balancer.jar')
PROP((liblist.usr 'DF99406,DE99406,DFROOT,DOROOT')) OPTION(*VERBOSE)
JOB(*GEN)
Gives me
Exception in thread "main" java.lang.NoClassDefFoundError:
org.apache.log4j.Appender
at java.lang.J9VMInternals.verifyImpl(Native
Method)
at
java.lang.J9VMInternals.verify(J9VMInternals.java:69)
at
java.lang.J9VMInternals.initialize(J9VMInternals.java:131)
Caused by: java.lang.ClassNotFoundException:
org.apache.log4j.Appender
at
java.net.URLClassLoader.findClass(URLClassLoader.java:498)
at
java.lang.ClassLoader.loadClass(ClassLoader.java:650)
at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at
java.lang.ClassLoader.loadClass(ClassLoader.java:616)
... 3
more
This works just fine. Same thing in my book.
java -Dliblist.usr=DF99406,DE99406,DFROOT,DOROOT -cp
/home/quikq/1.0/dev/log4j-1.2.16.jar:/QIBM/ProdData/OS400/jt400/lib/jt400Nat
ive.jar:/QIBM/ProdData/Java400/ext/db2_classes.jar:/home/quikq/1.0/dev/jargs
.jar:/home/dfcuser/Balancer.jar
Balancer --startcode 99406 --midnight --loglevel debug --limitsfile
DFCAVAILPT --logname /home/dfcuser/Balancer_99406_QA_T.log
Just trying to understand WTH I'm doing wrong with the RUNJVA. Thanks!
--
Kelly Beard
--
This is the Java Programming on and around the IBM i (JAVA400-L) mailing
list To post a message email: JAVA400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at
http://archive.midrange.com/java400-l.
--
This is the Java Programming on and around the IBM i (JAVA400-L) mailing
list To post a message email: JAVA400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at
http://archive.midrange.com/java400-l.
As an Amazon Associate we earn from qualifying purchases.