• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Javac problem

 
BJ Michaud
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
BJ Michaud
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yea i dont have that. Do you know where i can download that?
 
Misha Ver
Ranch Hand
Posts: 470
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
BJ Michaud, could you tell would did you downloaded and installed already
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 50175
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank You so much!!! it finally works now.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic