Results 1 to 9 of 9
Thread: What's wrong with this program?
- 10-31-2011, 07:13 AM #1
Member
- Join Date
- Oct 2011
- Posts
- 7
- Rep Power
- 0
What's wrong with this program?
First_Cup.java
----------------------------------------------------------------------------
import java.awt.Rectangle;
public class First_Cup {
public static void main(String[] args){
Rectangle cerealBox = new Rectangle(5,10,20,30);
cerealBox.translate(15,25);
System.out.println(cerealBox);
System.out.println("First Cup!");
}
}
I could compile this program successfully; but the byte code could not possibly run.
I have no idea why it could not run. Could somebody tell me why?
Runtime Error Message:
Exception in thread "main" java.lang.NoClassDefFoundError: First_Cup/class
Could not find the main class: First_Cup.class. Program will exit.
- 10-31-2011, 07:17 AM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,400
- Blog Entries
- 7
- Rep Power
- 17
Re: What's wrong with this program?
I bet you tried to run it as
Don't do that and read the tutorials how you are supposed to run your class.Java Code:java First_Cup.class
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 10-31-2011, 07:29 AM #3
Member
- Join Date
- Oct 2011
- Posts
- 7
- Rep Power
- 0
Re: What's wrong with this program?
I have run the command already; yet it still does not work.
- 10-31-2011, 07:35 AM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,400
- Blog Entries
- 7
- Rep Power
- 17
- 10-31-2011, 07:41 AM #5
Member
- Join Date
- Oct 2011
- Posts
- 7
- Rep Power
- 0
Re: What's wrong with this program?
The newly received message:
Exception in thread "main" java.lang.UnsupportedClassVersionError: First_Cup : Unsupported major.minor version 51.0
...
Could not find the main class: First_Cup. Program will exit.
- 10-31-2011, 08:03 AM #6
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,400
- Blog Entries
- 7
- Rep Power
- 17
Re: What's wrong with this program?
When people rob a bank they get a penalty; when banks rob people they get a bonus.
- 11-01-2011, 07:39 AM #7
Member
- Join Date
- Oct 2011
- Posts
- 7
- Rep Power
- 0
Re: What's wrong with this program?
Sorry. It's just worked.
- 11-01-2011, 07:45 AM #8
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,400
- Blog Entries
- 7
- Rep Power
- 17
- 11-02-2011, 01:01 PM #9
Member
- Join Date
- Oct 2011
- Posts
- 7
- Rep Power
- 0
Similar Threads
-
What is wrong with this program!?
By flecdorbee in forum New To JavaReplies: 5Last Post: 02-26-2011, 01:11 AM -
what the wrong in my program ><
By MSs.Java in forum New To JavaReplies: 4Last Post: 05-03-2010, 01:28 PM -
Wrong Order in Program Run
By HeatR216 in forum New To JavaReplies: 0Last Post: 03-25-2010, 08:41 PM -
What's wrong in my program...?
By Annatar in forum Java SoftwareReplies: 3Last Post: 10-31-2008, 06:03 AM -
what is wrong with this program ?
By Poor Bee in forum New To JavaReplies: 1Last Post: 05-07-2008, 07:23 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks