| 
 | 
I just tried to compile and run a simple Java program that instantiates an
AS400 object, and calls a method on it. And I've run into a problem.
It refused to compile unless I gave it a "-classpath
/QIBM/ProdData/HTTP/Public/jt400/lib/jt400.jar". The docs led me to
believe that this was supposed to be implicitly in the system classpath.
Then, if I call it without specifying the aforementioned classpath on the
Java call, it fails to find the AS400 class. But if I call it and I DO
specify the aforementioned classpath, it refuses to find my test class.
The source is as follows:
import com.ibm.as400.access.*;
class test01 {
   public static void main (String args[]) {
       System.out.println("I like spam!");
       AS400 as400 = new AS400("localhost");
       System.out.println("CCSID = " + as400.getCcsid());
   }
}
I compiled it with:
    javac -classpath /QIBM/ProdData/HTTP/Public/jt400/lib/jt400.jar
test01.java
If I call it as:
    java test01
I get:
    I like spam!
    java.lang.NoClassDefFoundError: com/ibm/as400/access/AS400
          test01.main([Ljava/lang/String;)V+8 (test03.java:5)
If I call it as:
    java -classpath /QIBM/ProdData/HTTP/Public/jt400/lib/jt400.jar test01
I get:
    Attaching Java program to /QIBM/ProdData/HTTP/Public/jt400/lib/jt400.jar.
    java.lang.NoClassDefFoundError: test01
HHHHEEEEEEEEEEELLLLLLLLLLLLLLLPPPPPPPPPPPP       
MMMMEEEEEEEEEEEEEEEEEEEEE!!!!!
--
JHHL
"If only getting Java to work on the 400 were as straightforward as coding
in MI . . . ."
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.