-
Error when running my 1st program
Below is my 1st Java pgm from an online course. I'm getting the error on the last line. I think it has to do with my environment, any help would be appreciated:
class BigDebt {
public static void main (String[] arguments) {
int debt = 446000000;
debt = debt / 1440;
System.out.println("A minute's worth of debt is $" + debt);
}
}
// C:\jv1\Unit2\bigdebt1>java BigDebt
// Exception in thread "main" Java.lang.NoClassDefFoundError: BigDebt
Thanks in advance,
Thanks in advance,
Jerry
-
Have you compiled the code to a .class file?
-
My 1st java program
Yes, I have compiled the code and created the BigDebt.class file.
Thanks in advance,
Jerry
-
in the dos box, type:
SET
in the output, look for something like:
CLASSPATH=C:\j2sdk1.4.2\jre\lib\rt.jar;c:\javamail-1.3.1\mail.jar;c:\jaf-1.0.2\activation.jar;.
yours will be different, but it should finish with:
;.
which means "the current directory"
if it does not, right click my computer, choose properties >> advanced >> environment variables >> and edit the classpath entry in the second pane, to include it ( ;. )
click OK to everything, close all dos windows, and try again
-
Thank you, thank you. Funny how minor things make a big difference. I added the semicolon and it worked.
Thanks again cjard.....
Thanks in advance,
Jerry
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks