This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes javac Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "javac" Watch "javac" New topic
Author

javac

anthony williams
Greenhorn

Joined: May 30, 2004
Posts: 1
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?
Mike Gershman
Ranch Hand

Joined: Mar 13, 2004
Posts: 1272
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.


Mike Gershman
SCJP 1.4, SCWCD in process
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

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?


[Jess in Action][AskingGoodQuestions]
Sean Lin
Greenhorn

Joined: May 30, 2004
Posts: 1
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;
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: javac
 
Similar Threads
ant pkg won't work for installing I2P
invalid LOC header - How to overcome this Exception?
Eclips error
java.lang.InternalError - invalid LOC header
errors generated when running Ant build file in Eclipse