|
If your class testMe1 is in the package home/msilvers (i.e. the first line says "package home.msilvers"), then you need to have the "home" directory in your classpath (which you don't). But if it isn't, then the class itself should be in the classpath (which it is), and you should just type "java testMe1" to run it. PC2 -----Original Message----- From: Mike Silvers [mailto:msilvers@hbs-inc.com] Sent: December 5, 2001 07:07 To: Java 400-L Subject: Am I missing something simple here? I am trying to run a class. I have the class in the classpath and every time I try to run the class, I get a class not found exception thrown. This is aggravating! Any ideas?? Here is the contents of the directory: ----------- Work with Object Links Directory . . . . : /home/MSILVERS Type options, press Enter. 2=Edit 3=Copy 4=Remove 5=Display 7=Rename 8=Display attributes 11=Change current directory ... Opt Object link Type Attribute Text . DIR .. DIR .profile STMF .random STMF testMe1.class STMF testMe1.java STMF testMe2.java STMF ----------- Here is the classpath variable: ----------- > echo $CLASSPATH /.:/home/MSILVERS $ ----------- Here is the current directory: ---------- > pwd /home/MSILVERS $ ---------- And here is the java command with the error: ---------- > java /home/msilvers/testMe1 java.lang.NoClassDefFoundError java/lang/ClassLoader.defineClass(Ljava/lang/String;[BIILjava/security/Prote ctionDomain;)Ljava/lang/Class;+79 (ClassLoader. java:486) java/net/URLClassLoader.defineClass(Ljava/lang/String;Lsun/misc/Resource;)Lj ava/lang/Class;+196 (URLClassLoader.java:270) java/net/URLClassLoader$ClassFinder.run()Ljava/lang/Object;+42 (URLClassLoader.java:572) java/net/URLClassLoader.findClass(Ljava/lang/String;)Ljava/lang/Class;+16 (URLClassLoader.java:198) java/lang/ClassLoader.loadClass(Ljava/lang/String;Z)Ljava/lang/Class;+41 (ClassLoader.java:297) sun/misc/Launcher$AppClassLoader.loadClass(Ljava/lang/String;Z)Ljava/lang/Cl ass;+33 (Launcher.java:286) java/lang/ClassLoader.loadClassInternal(Ljava/lang/String;)Ljava/lang/Class; +1 (ClassLoader.java:313) $ ---------- Mike ================================ Mike Silvers AS/400 Senior Programmer/Analyst AS/400 IBM Certified RPG IV Developer AS/400 IBM Certified Expert Hainey Business Systems 8 E. Canal St Dover, PA 17315 Branch Office: (410) 397-8739 Phone: (800) 932-3380 Fax: (717) 292-9474 Web: http://www.hbs-inc.com ________________________________ Providing E-Commerce, EDI, AS/400 Development and related services nationwide. ================================ _______________________________________________ This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) mailing list To post a message email: JAVA400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/java400-l or email: JAVA400-L-request@midrange.com 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-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.