|
Hi Jon, > Undoubtedly the classpath is involved ... but I think it must relate to > the base java classes. I don't think so. Your original message showed "java.lang.NoClassDefFoundError: TestClass" That tells you two things: 1) The JRE and base classes are found - otherwise nothing would have run and NoClassDefFoundError could not be thrown. 2) TestClass can't be found, which is a classpath issue. This should be a "is it plugged in and turned on?" thing. I understand that you don't think it is, but double check everything, please. The first step is to check your current directory. Next, check that TestClass.class exists in your current directory and ensure proper spelling. If both of these are true, I agree that "java TestClass" should run. From Java 1.2 on, if no classpath is given, the default is "." or current directory. If any of the above is not true, correct them. If you still have problems, check your installation and try running the included Java Hello program. See: < http://publib.boulder.ibm.com/infocenter/iseries/v5r3/ic2924/info/rzaha/getstart.htm > and look at the "Install and configure" and "Run your first Hello World Java" sections. The base Java classes are on the boot classpath; also any extension classes are auto found and loaded as necessary. For user classes, one of these must be true ( leaving out custom classloaders and that kind of thing ): A) CLASSPATH environment variable set. B) "java" command ( from command line ) has CLASSPATH parm set; equivalent to "java -cp myPath: myClass" in Qshell and other boxes. C) Neither of above, which uses "." as default; classes must be found from current directory. That should be enough to resolve your issue unless you have something truly weird going on. BTW, your empty no-arg constructor is not necessary; the compiler will create one if no other constructors are present. HTH, Joe Sam ( Who still uses the RPG cycle when it makes sense ;-P ) Joe Sam Shirah - http://www.conceptgo.com conceptGO - Consulting/Development/Outsourcing Java Filter Forum: http://www.ibm.com/developerworks/java/ Just the JDBC FAQs: http://www.jguru.com/faq/JDBC Going International? http://www.jguru.com/faq/I18N Que Java400? http://www.jguru.com/faq/Java400 ----- Original Message ----- From: "Jon Paris" <Jon.Paris@xxxxxxxxxxxxxx> To: <java400-l@xxxxxxxxxxxx> Sent: Sunday, May 29, 2005 1:17 PM Subject: RE: Dumb Question > Undoubtedly the classpath is involved ... but I think it must relate to the > base java classes. What is the normal default setting that normally allows > basic java code to run? I guess I'm going to have to check out the sys vals > and find out how the heck to set it in qshell (oh how I hate qshell .....) > > I've never had to include the directory in which the class resides in the > classpath itself before, and I certainly didn't have it in the classpath on > another system on which this code ran OK. It is in my current directory. > > > Jon Paris > Partner400 >
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 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.