This week's book giveaway is in the Java in General forum.
We're giving away four copies of Event Streams in Action and have Alexander Dean & Valentin Crettaz on-line!
See this thread for details.
Win a copy of Event Streams in Action this week in the Java in General 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
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

javac not recognized

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I just installed JDK 1.6.0_14 and i cannot seem to figure out a specific problem. I am trying to test a file that was created, and type in the command 'javac Filename.java' , I receive and error:
"'javac' is not recognized as an internal or external command, operable program or batch file."
There were no problems encountered in the installation process , so I do not know what is the problem.
If anyone can tell me how to fix the problem, it will be appreciated.

Thank you
 
Bartender
Posts: 2330
100
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you need to set the classpath
 
salvin francis
Bartender
Posts: 2330
100
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See this link on how to set the classpath

HowToSetTheClasspath
 
salvin francis
Bartender
Posts: 2330
100
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Forgot to say this :


Welcome to coderanch !!

 
Sheriff
Posts: 21775
103
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not the class path that needs to be set, but the PATH. The instructions are the same; just don't overwrite the PATH but add to the end.
 
salvin francis
Bartender
Posts: 2330
100
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, my bad

yes its the path variable that needs to be set.
 
Marshal
Posts: 65086
247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And don't set the CLASSPATH. More details about that error in the Java™ Tutorials and the installation instructions.
 
salvin francis
Bartender
Posts: 2330
100
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:And don't set the CLASSPATH. More details about that error in the Java™ Tutorials and the installation instructions.



Classpath not required at all ?

What if the application is using components such as swing ?
 
Rob Spoor
Sheriff
Posts: 21775
103
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Swing is part of the core libraries these days.

I think what Campbell is trying to say is: don't use a global class path, but set the class path using the "-cp" / "-classpath" flags as needed.
 
Campbell Ritchie
Marshal
Posts: 65086
247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Rob Prime wrote:I think what Campbell is trying to say is: don't use a global class path, but set the class path using the "-cp" / "-classpath" flags as needed.

Yes, you are right Rob. Sorry I wasn't clear. The only intance when you have to edit a system classpath is if there already is a system classpath, in which case it needs to have a . added somewhere.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!