Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: javac

  1. #1
    Junior Member
    Join Date
    Nov 2020
    Thanked 0 Times in 0 Posts

    Default javac

    hello everyone!

    I am brand spanking new to programming with java. That being said, I have found a couple tutorials that I am walking through on the internet to get acquainted with java. But I am having trouble with compiling the code.

    I have opened a cmd prompt and navigated to where I saved the program. I then followed the directions and ran the command "javac FirstJavaProgram.java".

    I then get an error of 'javac' is not recognized as an internal or external command, operable program or batch file.

    The tutorials said this could happen and then gave steps to follow to set the java path.
    The command is as follows: set path=C:\Program Files\Java\jre.1.8.0_271\bin.

    That command didn't work. I still received the same error as before. So I googled how to set the path and followed the prompts to go through the properties window.
    Right clicked computer, clicked Properties, clicked Advanced System Settings, clicked Environment Variables, found PATH under System Variables, and changed it.

    After all that I went back into my cmd prompt and tried to run the program again. With still the same result. (bangs head on desk).

    Can someone tell me what I'm doing wrong? Is is something blatantly obvious that I am missing?

    Thank you for any help!!

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Eastern Florida
    Thanked 2,708 Times in 2,658 Posts

    Default Re: javac

    Does the PATH variable have the path to the folder with the javac.exe file?
    To view the contents of PATH, open a command prompt and enter: path
    The full contents should show in the command prompt window. If you can't see the problem, copy the window's contents and paste it here.

    To copy the contents of the command prompt window:
    Click on Icon in upper left corner
    Select Edit
    Select 'Select All' - The selection will show
    Click in upper left again
    Select Edit and click 'Copy'

    Paste here.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Why javac does not recognise this and cannot run as an app?
    By zsinyi2 in forum What's Wrong With My Code?
    Replies: 4
    Last Post: January 7th, 2018, 11:29 AM
  2. Have problem with javac
    By AleksandraVulisic in forum What's Wrong With My Code?
    Replies: 5
    Last Post: September 9th, 2017, 09:11 AM
  3. JAVAC
    By iansmiler in forum What's Wrong With My Code?
    Replies: 6
    Last Post: November 27th, 2012, 03:45 PM
  4. javac help
    By mjpam in forum Java Theory & Questions
    Replies: 7
    Last Post: February 16th, 2011, 10:46 AM
  5. Problem of executing java.exe. How to code from absolute scratch?
    By sepalm in forum Java Theory & Questions
    Replies: 13
    Last Post: November 12th, 2008, 07:48 AM

Tags for this Thread