5 Replies - 706 Views - Last Post: 27 November 2012 - 03:12 PM Rate Topic: -----

#1 Jon777666321   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 26-November 12

Beginner: javac command is not being recognized by the command console

Posted 27 November 2012 - 02:19 PM

I am trying to teach myself to do some basic java programming using this website: http://www.null-devi...imer/part1.html

I was instructed to create a HelloWorld program using code that I copy/pasted into a notepad file. I was then instructed to open the command console and use the command "javac HelloWorld.java", but I recieved an error message telling me that the command is not recognized.

Following some advice I go on here, I uninstalled all Java programs off of my computer, and re-installed. This is what I have done:
-downloaded jdk-7u9-windows x64 and ran the installer
-left selected Development Tools, Source Code, and Public JRE in optional features
-I downloaded to the suggested locations, so for the first loading screen it was C:\Program Files\Java\jdk1.7.0_09\ and for the second it was C:\Program Files\Java\jre7\
-a message informed me that “Java SE Development Kit 7 Update 9 (64-bit) Successfully Installed” and asked me to register, which I ignored and closed the window

I then returned to the command console and tried "javac HelloWorld.java" again, recieving the same error code "'javac' is not recognized as an internal or external command, operable program or batch file."

What am I missing, or what do I have to change to make it work?

Is This A Good Question/Topic? 0
  • +

Replies To: Beginner: javac command is not being recognized by the command console

#2 pbl   User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8381
  • View blog
  • Posts: 31,956
  • Joined: 06-March 08

Re: Beginner: javac command is not being recognized by the command console

Posted 27 November 2012 - 02:26 PM

You will have to put the Java \bin direcory in your %PATH% variable

Attached image(s)

  • Attached Image

This post has been edited by pbl: 27 November 2012 - 02:32 PM

Was This Post Helpful? 0
  • +
  • -

#3 Jon777666321   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 26-November 12

Re: Beginner: javac command is not being recognized by the command console

Posted 27 November 2012 - 02:29 PM

As I said, I am just starting out. Can you tell me how to do that exactly?
Was This Post Helpful? 0
  • +
  • -

#4 pbl   User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8381
  • View blog
  • Posts: 31,956
  • Joined: 06-March 08

Re: Beginner: javac command is not being recognized by the command console

Posted 27 November 2012 - 02:34 PM

Depends on yiour Windows flavor but basically

- Control Panel
--- System
------ Advanced
-------- Environment Variable

modify PATH by appending to hit after a ; the Java path to look like the one I have added in my previous post
Was This Post Helpful? 0
  • +
  • -

#5 Jon777666321   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 26-November 12

Re: Beginner: javac command is not being recognized by the command console

Posted 27 November 2012 - 03:04 PM

Okay, so now it responds to the javac command but it says "javac: file not found: HelloWorld.java" even though the notepad text file is in the directory.
Was This Post Helpful? 0
  • +
  • -

#6 Jon777666321   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 26-November 12

Re: Beginner: javac command is not being recognized by the command console

Posted 27 November 2012 - 03:12 PM

Nevermind, there was simply a misspelling on my file name. Everything is working fine now. Thank you!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1