File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes 2 Questions - I'm Really At A Loss! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "2 Questions - I Watch "2 Questions - I New topic
Author

2 Questions - I'm Really At A Loss!

Gary Farms
Ranch Hand

Joined: Jun 24, 2000
Posts: 57
Below is my program Access.java which resides in c:\java.
It generates a "NoClassDefFoundError" when I run it. I have No idea why. Also, I've always had to put a package statement
at the top of all my .java files. Otherwise, they will compile, but won't run. To run Access.java, I compile it, then copy
Access.class to c:\com\gfarms\geometry then run it at c:\java
by doing java com.gfarms.geometry.Access
My 2 questions are:
1. Why do I get this "NoClassDefFoundError" when I run Acces.java?
2. What is wrong with my classpath, that requires me to put a package statement in all my .java files?
Anyway, here's my path and classpath statements in c:\autoexec.bat
path=c:\windows;c:\windows\command;c:\jdk1.3.0_02\bin;c:\java\;
set classpath=c:\jdk1.3.0_02\lib;c:\java\;
Finally, here's my c:\java\Access.java program that blows up:
//Access.java
package com.gfarms.geometry;
class Other
{
public void fnc(String b)
{
int y = 10;
System.out.println("string received = " + b);
System.out.println("y = " + y);
}
}
public class Access
{
public static void main(String[] args)
{
Other a = new Other();
a.fnc("Gary Farms");
}
}
Any help to my 2 above questions would be deeply appreciated!
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Gary I answered this in beginner. PLEASE do not cross post.


"JavaRanch, where the deer and the Certified play" - David O'Meara
 
Don't get me started about those stupid light bulbs.
 
subject: 2 Questions - I'm Really At A Loss!