File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Javac problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Javac problem " Watch "Javac problem " New topic
Author

Javac problem

BJ Michaud
Greenhorn

Joined: Mar 03, 2008
Posts: 5
i have been researching now for about 8 hours total now trying to add java to my computer. All i want to do is to compile programs using javac. I have Vista on my computer and i have downloaded the jdk version of java 1.6. Javac is just not workin. i have tried the helloworldapp but still all i get is javac is not reconized as an internal or external file. Its drivin me crazy can someone help me plase

Thank you
BJ
Krep Lock
Ranch Hand

Joined: Sep 19, 2006
Posts: 43
I'm no expert, but it sounds like your CLASSPATH system variable may be causing a problem. Try compiling with the -cp switch like so:

C:\>javac -cp . helloworldapp.java
Krep Lock
Ranch Hand

Joined: Sep 19, 2006
Posts: 43
Whoops, I think I read your post a bit too quickly. I see now that your system isn't even finding the javac command. Firstly, verify you have the file. On my system (win2k3 server) it's:

C:\Program Files\Java\jdk1.6.0_03\bin\javac.exe

So try a file search. You'll want to add the java bin directory to your PATH.
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Originally posted by Krep Lock:
...You'll want to add the java bin directory to your PATH.

That's exactly right. See step 4 of the installation instructions.


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
BJ Michaud
Greenhorn

Joined: Mar 03, 2008
Posts: 5
yea i dont have that. Do you know where i can download that?
Misha Ver
Ranch Hand

Joined: Mar 03, 2008
Posts: 470
BJ Michaud, could you tell would did you downloaded and installed already
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Originally posted by BJ Michaud:
yea i dont have that. Do you know where i can download that?

See Sun's Java SE download page. And be sure to follow the installation instructions.
BJ Michaud
Greenhorn

Joined: Mar 03, 2008
Posts: 5
i downloaded jdk1.6.0 and still no javac. I can open java files that i have compiled on a computer at school but i cant compile on my own computer.
BJ Michaud
Greenhorn

Joined: Mar 03, 2008
Posts: 5
I did exacly what step 4 told me to do and it is javac is still not working. Still gettin same message not internal or external command
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37939
    
  22
Instead of "javac" write "path" on a command prompt. You will get a set of Strings separated by ; like this:
C:\Documents and Settings\CampbellAndRuth>path
PATH=C:\Program Files\Emacs\\bin;C:\ProgramFiles\Java\jdk1.6.0_03\bin;C:\Program Files\MySQL\MySQL Server 5.0\bin;C:\Program Files\Microsoft Office\OFFICE11\Bu
siness Contact Manager\IM;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;C:\Program Files\Microsoft Office\OFFICE11\Business Contact Manager\;C:\Program Files\Mozart\bin;C:\Program Files\emacs-22.1-bin-i386\emacs-22.1\bin
Make sure there is something like C:\Program Files\Java\jdk1.6.0_03\bin; in it. (Only it is more likely you will have jdk1.6.0_04.) Navigate to that file and make sure it contains a list of executable files like, java, appletviewer, javac, javaw, javah, javap, etc. There should be about 30 of them.

Your PATH must correspond to where you installed the JDK files. If there are two references to Java files in the PATH, the most recent version ought to appear first.
BJ Michaud
Greenhorn

Joined: Mar 03, 2008
Posts: 5
Thank You so much!!! it finally works now.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Javac problem
 
Similar Threads
can't find javac in jdk1.5.0
Installing JDK in Windows 7
invalid LOC header - How to overcome this Exception?
JRE and settings
Unable to compile Jsp