• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

javac

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello, I am new to java programming. I installed the j2sdk on my computer and everything seems fine. I can go to the dos prompt and run an application. I can't seem to compile my java files. When I type javac plus the java file name it returns "Bad command or file name"
is my classpath and /or path in my autoexec.bat wrong?
 
Ranch Hand
Posts: 1272
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This sounds like an error in your path.

You can check this by typing path at a DOS prompt. Be sure the result includes the fully qualified name of the directory containing javac.exe. Do a search on javac.exe to verify the directory name.
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Anthony,

Welcome to JavaRanch!

If you can type "java" to run an app, but not "javac" to compile it, then perhaps you installed only the "JRE" (the Java Runtime Environment) instead of the J2SDK?
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If u use windows system, right click on My Computer --> Properties --> Advanced --> Environment Variables, find the variable named "Path",
and double click on it. In the variable field, add C:\j2sdk1.4.2_04\bin;
 
reply
    Bookmark Topic Watch Topic
  • New Topic