Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

marcy124

macrumors newbie
Original poster
Nov 25, 2006
4
0
Hi.. I'm new in java and I have a problem when I compile my program.

This is the code is a small code

public class Lab03Gst
{

public static void main(String[] args)
{
int milli = 10000123;
int hours = 10000123/3600000;
int minutes = 1000/60;
int seconds = 1000 % 60;
int milliS = 10000123%1000;
System.out.println ("Lab 03G, 100 Point Version\n");
System.out.println ("Starting milli-seconds: " + milli);
System.out.println ("Hours: " +hours);
System.out.println ("Minutes: " + minutes);
System.out.println ("Seconds: " + seconds);
System.out.println ("MIlli Seconds: " + milliS);
System.out.println ();

}

}

It compiles giving me a "Lab03Gst.class" file but when i type this :

java Lab03Gst

I get this error: Exception in thread "main" java.lang.NoClassDefFoundError: /Users/marcela/Desktop/Lab03Gst

:confused: I hope someone can help me thanks
 
...
It compiles giving me a "Lab03Gst.class" file but when i type this :

java Lab03Gst

I get this error: Exception in thread "main" java.lang.NoClassDefFoundError: /Users/marcela/Desktop/Lab03Gst

Are you sure you tried "java Lab03Gst" and not "java /Users/marcela/Desktop/Lab03Gst"?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.