Page 3 of 3 FirstFirst 123
Results 51 to 54 of 54

Thread: Learning Java ~ What are the best choices of tools ?

  1. #51
    Jedi knight Luke Skywalker's Avatar
    Join Date
    Jul 2009
    Age
    23
    Liked
    0 times
    Posts
    2,175

    Default

    Wait for one day I am installing windows to solve this issue. Can't understand as path is showing bin in the path.

  2. #52
    newprouser
    Guest

    Default

    hey luke, sorry i forgot to update here, nandini's method is working fine. now both javac and java command are working from cmd.

    thanks for your help.

    meanwhile what is wrong in this code ?

    public class MyFirstApp
    {
    public static void main ()
    {
    System.out.println("I rule ");
    System.out.println("the world.");
    }
    }
    Saved as MyFirstApp.java.

    NO problems in compiling , but in execution i get this error.

    F:\Documents and Settings\Administrator\Desktop>java MyFirstApp
    Exception in thread "main" java.lang.NoSuchMethodError: main
    F:\Documents and Settings\Administrator\Desktop>java MyFirstApp.class
    Exception in thread "main" java.lang.NoClassDefFoundError: MyFirstApp/class
    Caused by: java.lang.ClassNotFoundException: MyFirstApp.class
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    Could not find the main class: MyFirstApp.class. Program will exit.

  3. #53
    Jedi knight Luke Skywalker's Avatar
    Join Date
    Jul 2009
    Age
    23
    Liked
    0 times
    Posts
    2,175

    Default

    Write main statement as

    public static void main (String[] args)

    So program is:-

    public class MyFirstApp
    {
    public static void main (String[] args )
    {
    System.out.println("I rule ");
    System.out.println("the world.");
    }
    }




    PS: Then I am not going to install windows.
    Last edited by Luke Skywalker; 08-01-09 at 07:51 PM. Reason: Automerged Doublepost

  4. #54
    newprouser
    Guest

    Default

    thanks again, finally i got one program working

Page 3 of 3 FirstFirst 123

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. photo editing tools
    By zoooni in forum Computer technology
    Replies: 5
    Last Post: 05-15-10, 09:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •