Win a copy of Learning Java by Building Android Games this week in the Android forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

javac not found Windows 7 solved  RSS feed

 
Greenhorn
Posts: 1
Chrome Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This took me the past four hours to figure out.
java -version worked like a charm every time it was ran.
javac did not work after setting PATH and CLASSPATH
I followed googled/youtoubed? instructions to no avail!

The books and google and you tube instruction overlooked one thing for Windows 7.

You must reboot the computer after setting the Systems Environment for PATH and CLASSPATH.

I did not get why a couple of people requested that you type the PATH command at the prompt. After I unistalled an older jdk and installed a newer one I noticed PATH was not updating.

I referenced Windows 7 Inside Out Microsoft Press and confirmed that you have to reboot for the systems environment variables to take affect. My programs are compiling with joyful errors now.
 
Marshal
Posts: 60749
189
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

That is useful information, which I didn't know. Maybe I ought to add that to our FAQ.
 
Campbell Ritchie
Marshal
Posts: 60749
189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I earlier wrote: . . . Maybe I ought to add that to our FAQ].

Done. Thank you for the information.
 
Java Cowboy
Sheriff
Posts: 16084
88
Android IntelliJ IDE Java Scala Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure that it's necessary to completely reboot the computer after adding or changing a system environment variable.

You do have to close and re-open the command prompt window though (not only on Windows 7, but also on Vista and XP), because the command prompt only reads the variables at the moment you open it - it will not pick up changes while it's open.
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Jesper de Jong wrote:I'm not sure that it's necessary to completely reboot the computer after adding or changing a system environment variable.

You do have to close and re-open the command prompt window though (not only on Windows 7, but also on Vista and XP), because the command prompt only reads the variables at the moment you open it - it will not pick up changes while it's open.



No need to restart the machine really, just restart the command prompt. Would be interesting to update this information in the faq
 
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no need to reboot/restart the PC after the change in PATH or CLASSPATH system environments.
I am also using Windows 7 and i am changing them many times for JavaSE6 or JavaSE7...
I never restart my PC, but obviously restart the command prompt....
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!