Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

OCAJP Study Guide Chapter 1

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

   I'm currently studying for Chapter 1 of the OCAJP Study Guide Chapter 1 and I'm currently stuck in compiling a Java Program in Command Prompt or CMD. I tried to follow the example of the Zoo class but when I tried to run and compile the Zoo class in the CMD by typing javac Zoo.java, the message says that "javac is not recognized as an internal or external command, operable program or batch file.

   Upon checking, I have JRE installed on my computer. Please help me figure out how can I run a sample java program in the Command Prompt. Thank you and I look forward to any helpful response.
 
Greenhorn
Posts: 1
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lenard

You are currently using the JRE (Java Runtime Environment) which can run java programs but not compile them. You need to download a JDK (Java Development Kit) to compile java code.

Hope that helps.
Steve J
 
Marshal
Posts: 69894
278
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

How do you know that OP didn't download the JDK? It is more common to see that error message because you have installed the right thing but not set the system PATH correctly. See our FAQ. If you use Windows®10 and you get the PATH elements in a dropdown list in ttheir own window, make sure to give each PATH element a line to itself.
 
    Bookmark Topic Watch Topic
  • New Topic