problem with java

Discussion in 'Mac Programming' started by marcy124, May 5, 2007.

  1. marcy124 macrumors newbie

    Joined:
    Nov 25, 2006
    #1
    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
     
  2. Allanist macrumors newbie

    Joined:
    Mar 18, 2007
    #2
    Are you sure you tried "java Lab03Gst" and not "java /Users/marcela/Desktop/Lab03Gst"?
     

Share This Page