• Post Reply Bookmark Topic Watch Topic
  • New Topic

'javac' is not recognized...blah blah blah  RSS feed

 
Ranch Hand
Posts: 4696
8
Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
as some of you know, my computer recently crashed. what is worse is I did not backup my latest project.
well, I have a new computer now and I have been having nothing but problems. I tried to download what I had before. javaEE + JDK. I tried it twice but the downloaded file would not extract(install). so I got just the JDK by itself. that installed fine and seemed to work. the first thing I tried was running one of my programs from the command prompt. that worked, so I started rewriting my lost project. fortunately, almost half the code was here at the ranch from questions I posted. after about 4 or 5 hours I have rewritten most of it. I decided to try compiling it and I get the error message. how can it find the java command but not the javac command?

when I got it a couple of years ago(java7) it installed and ran perfectly. I didn't have to do anything.

any help appreciated
 
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Randall Twede wrote:how can it find the java command but not the javac command?

It could be you have the JRE installed and not the JDK, or you have the JDK installed and have the PATH variable pointing to the JRE that comes with the JDK instead of the JDK itself.

If you use Windows Explorer, can you navigate to C:\Program Files\Java? What sub-folders do you have? Is one of them labeled jdk? Can you navigate through the folders and find the javac executable?

Right-click on the Computer icon (My Computer icon) and choose Properties, then click on the Advanced System Settings link on the left, and click on the Environment Variables button. Find the Path variable. Is the directory where you found the javac executable in the Path?
 
Randall Twede
Ranch Hand
Posts: 4696
8
Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Steve, I think you set me on the right course. I never had to set the Path before(the installation did it for me) as for the light bulbs, I didn't follow the link, but the government dictating which light bulbs you can get is tyrany
 
Marshal
Posts: 56610
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The link leads to a film about light bulbs. It must be bogus, because it shows a woman turning light‑switches off
Pleased you have got the PATH working.
 
Randall Twede
Ranch Hand
Posts: 4696
8
Java Scala
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well that was a strange experience. I could not find the java folder or javac. so I double clicked the installation file. it told me it was already installed, but let me reinstall it. this time I could find the folders and files. I did have to edit the PATH. now it is working correctly
 
Campbell Ritchie
Marshal
Posts: 56610
172
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well done
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!