new: problem compiling java programs

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nehaatray
    New Member
    • Feb 2007
    • 3

    #1

    new: problem compiling java programs

    hi, i am basically a beginner, trying to find my way in java. i downloaded the jdk1.4. i tried to write a sample program and compile/run it with javac in commnad prompt. i made sure i set the path correctly. cant figure out why it shows this problem.
    my sample program is:


    public class hellouser{)
    public static void main(string[] arguments) {
    string username = system.getprope rty( "user.name" );
    system.out.prin tln( "hello, " + username);
    }
    }

    the error on compilation is:
    javac hellouser.java
    'JAVAC' is not recognized as an internal or external command, operable program or batch file.

    what is wrong???? i did set the path to my current program .
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by nehaatray
    hi, i am basically a beginner, trying to find my way in java. i downloaded the jdk1.4. i tried to write a sample program and compile/run it with javac in commnad prompt. i made sure i set the path correctly. cant figure out why it shows this problem.
    my sample program is:


    public class hellouser{)
    public static void main(string[] arguments) {
    string username = system.getprope rty( "user.name" );
    system.out.prin tln( "hello, " + username);
    }
    }

    the error on compilation is:
    javac hellouser.java
    'JAVAC' is not recognized as an internal or external command, operable program or batch file.

    what is wrong???? i did set the path to my current program .
    You nead to set the PATH of Java on your sytem. But first, I suggest you unistall the 1.4, go back to the sun and download jdk 1.5 or higher and install that.

    Comment

    • hirak1984
      Contributor
      • Jan 2007
      • 316

      #3
      this problem occurs when path is not set properly.make sure you are compiling the code fron inside bin of jdk.

      if you want to compile and run from anywhere,then set environment variable of windows.
      if the probl;em persistes even after doing these let us know.
      Originally posted by nehaatray
      hi, i am basically a beginner, trying to find my way in java. i downloaded the jdk1.4. i tried to write a sample program and compile/run it with javac in commnad prompt. i made sure i set the path correctly. cant figure out why it shows this problem.
      my sample program is:


      public class hellouser{)
      public static void main(string[] arguments) {
      string username = system.getprope rty( "user.name" );
      system.out.prin tln( "hello, " + username);
      }
      }

      the error on compilation is:
      javac hellouser.java
      'JAVAC' is not recognized as an internal or external command, operable program or batch file.

      what is wrong???? i did set the path to my current program .

      Comment

      • cnixuser
        New Member
        • Dec 2006
        • 80

        #4
        If you are using Windows, try this site: http://support.microso ft.com/kb/310519
        You may also find this page helpful: http://www.wilsonmar.c om/1envvars.htm

        Comment

        Working...