|
James
I think the path to your class needs to be on the classpath
Eg if your class is in /java/classes
Then your classpath is
/java/classes:/QIBM/ProdData/HTTP/Public/jt400/lib/jt400.jar
This is assuming that you are using the default package (ie no package),
which is not recommend anyway.
So if you put you class in a package
Eg
Package james.lampert:
Then your class test01 would be in directory /java/classes/james/lampert
And you javac command would be
javac
-classpath
/java/classes:/QIBM/ProdData/HTTP/Public/jt400/lib/jt400.jar
james.lampert.test01.java
cheers
Colin.W
http://as400blog.blogspot.com
Extension 5800
Direct dial 0870 429 5800
-----Original Message-----
From: James H H Lampert [mailto:jamesl@xxxxxxxxxxx]
Sent: 10 December 2004 01:25
To: java400-l@xxxxxxxxxxxx
Subject: Problem with my first "baby steps" into the Toolbox
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 . . . ."
--
This is the Java Programming on and around the iSeries / AS400 (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 e-mail has been sent by a company of Bertram Group Ltd, whose registered
office is 1 Broadland Business Park, Norwich, NR7 0WF.
This message, and any attachments, are intended solely for the addressee and
may contain privileged or confidential information. If you are not the
intended recipient, any disclosure, copying, distribution or any action taken
or omitted to be taken in reliance on it, is prohibited and may be unlawful.
If you believe that you have received this email in error, please contact the
sender immediately. Opinions, conclusions and statements of intent in this
e-mail are those of the sender and will not bind a Bertram Group Ltd company
unless confirmed in writing by a director independently of this message.
Although we have taken steps to ensure that this email and any attachments are
free from any virus, we advise that in keeping with good computing practice the
recipient should ensure they are actually virus free.
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.