Results 1 to 4 of 4

Thread: unable to compile java file in ms-dos

  1. #1
    Join Date
    Dec 2008
    Posts
    24

    unable to compile java file in ms-dos

    javac is not recognized as internal or external command

    I have been learning java since the beginning of some courses in Java programming. And yesterday, with the help of the teacher, I finally managed to make my first (very simple) program . To see if the program works well, the teacher told me to go to MS-DOS in the directory where the file is located, and type: "javac filename"

    But when i type this , I got this message "javac" is not recognized as internal or external command. Being a true pure novice in this field, I need ask you: where is the problem? I could see the need to move in the environment variables ..

  2. #2
    Join Date
    May 2008
    Posts
    115

    Re: unable to compile java file in ms-dos

    Javac is a exe which is found in the bin folder of your JDK sotherefore you probably didn't add it to you classpath so thereforecommand prompt doesnt know how to find "javac".

    Follow this Steps For Windows--
    1. Control Panel
    2. Click System
    3. Click Advanced
    4. Environment Variables
    5. Edit your class path and add the bin folder of your JDK.

  3. #3
    Join Date
    Jan 2008
    Posts
    1,521

    Re: unable to compile java file in ms-dos

    It must first you have the compiler (and reader, for that matter) java (JAVAC), if this is not the case, you can download on Sun's site:

    http://www.javelinfeedback.com/sun/i...06a7765ee5d4ca

    you install it and if it is not enough, said the system MS-DOS where javac.exe:

    set PATH =% PATH% c: \ jdk1.4 \ bin

    Explanatory Note:
    As javac.exe is an external command, but it is not in a default directory of Windows (Windows, System32 ...), it can not find that with this command (which tells simply that the new path (path of external default) is the old + path where javac.exe).

  4. #4
    Join Date
    Feb 2008
    Posts
    1,852

    Re: unable to compile java file in ms-dos

    For running the program you need to have the JDK installed instead of
    the JRE. JRE provides just the environment for precompiled code to
    run. You ca download JDK from java.sun.com

Similar Threads

  1. Unable to compile managed C++ code by using the VC 7.0
    By fanish-war in forum Software Development
    Replies: 4
    Last Post: 25-06-2011, 09:46 PM
  2. Compile java program from mobile
    By Maya Angelou in forum Software Development
    Replies: 4
    Last Post: 01-04-2010, 09:15 AM
  3. Unable to Save A File In Java
    By D_chapple in forum Software Development
    Replies: 5
    Last Post: 08-03-2010, 09:41 PM
  4. Compile and execute a program in java
    By ISAIAH in forum Software Development
    Replies: 5
    Last Post: 03-03-2010, 01:07 PM
  5. Unable to compile and execute code
    By spuff in forum Software Development
    Replies: 5
    Last Post: 24-12-2009, 01:56 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,311,963.75060 seconds with 17 queries