|
I wouldn't try learning this on an iSeries, unless all you have is a dumb
terminal.
You could compile a very simple class, like HelloWorld without your
classpath set, but you will not be able to run it.
Your classpath is not correct. At a minimum, it needs to include /Java.
You can also do a CHGCURDIR to /Java prior to entering QShell. Then just
make sure that '.' is in your classpath.
The reference to the ../jt400/lib folder in your classpath is also not
correct. You can only put folders in your classpath if the folder
contains .class file (including the package directories). "lib" folders
typically contain JAR files. JAR files have to be specifically added to
your classpath.
So, let's assume that you want jt400.jar in your classpath for some
reason. Your classpath environment variable should look like this:
/Java:/QIBM/ProdData/HTTP/Public/jt400/lib/jt400.jar:
/QIBM/ProdData/HTTP/Public/jt400/lib/data400.jar:
/QIBM/ProdData/HTTP/Public/jt400/lib/x4j400.jar
And you could possibly have replaced /Java with a single dot, provided
your current directory was /Java.
.:/QIBM/ProdData/HTTP/Public/jt400/lib/jt400.jar:
/QIBM/ProdData/HTTP/Public/jt400/lib/data400.jar:
/QIBM/ProdData/HTTP/Public/jt400/lib/x4j400.jar
Mark
"Steven Molinaro" <smolinaro@xxxxxxxxxxxxx>
Sent by: java400-l-bounces@xxxxxxxxxxxx
09/23/2003 01:42 PM
Please respond to Java Programming on and around the iSeries / AS400
To: <java400-l@xxxxxxxxxxxx>
cc:
Subject: Frustration!!
As a newbie to Java on the 400, I am perplexed by the classpath issue. I
simply want to run the HelloWorld program from a command line. I have
the source in /Java. From within QSH, I did a "cd /Java, and then a
javac HelloWorld.java".
The compile was successful and the class file now exists in /Java. When
I do a java HelloWorld, from within QSH OR from a OS/400 command line, I
get all sorts of errors. The first being
"java.lang.NoClassDefFoundError".
What I don't understand is if I am able to compile the program, doesn't
that mean that the classpath is set correctly and I should be able to
run it without any problems? Any suggestions would be greatly
appreciated. By the way, if it helps, my CLASSPATH ENVVAR is set to
"'/QIBM/ProdData/HTTP/Public/jt400/lib/'"
_______________________________________________
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.
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.