CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2017
    Posts
    2

    Javac not recognized in cmd prompt

    Hello, I just began learning Java programming today. I am going through a course online very basic instructions of writing the source in notepad and saved as Hello.java under all files. JDK is downloaded on my Windows 10. Whenever I try to compile I get this message:

    C:\Users\olivi\JavaSource>javac Hello.java
    'javac' is not recognized as an internal or external command,
    operable program or batch file.

    I hear this is common problem and can be fixed through a PATH variable. Can anyone describe that to me and the steps so the complier is recognized? Thanks in advance!

    I tried telling cmd prompt where javac was and it didn't work either.
    C:\Users\olivi\JavaSource>C:\\"Program Files\"\Java\jdk1.8.0_05\bin\javac Hello.java
    The system cannot find the path specified.

  2. #2
    Join Date
    Aug 2017
    Posts
    36

    Re: Javac not recognized in cmd prompt

    First make sure you have installed jdk and jre, both are installed with the java software development kit. The installation folder is typically C:\Program Files\Java.

    Now go to Computer > Properties > Advanced system settings in the advanced tab click on Environment Variables

    In System variables find the variable named Path, in the value of Path you will find a java path like C:\ProgramData\Oracle\Java\javapath, just change it to C:\Program Files\Java\jdk1.x.x_x\bin.

  3. #3
    Join Date
    Nov 2017
    Posts
    2

    Re: Javac not recognized in cmd prompt

    Thank you!

Tags for this Thread

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured