• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Installing JDK in Windows 7

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey all at Java Ranch,

I apologize in advance for my noobish question but here it goes

I am quite new to java and I have been reading my intro book and I ran into a hitch I installed the latest version of the JDK and when through the setup wizard and the process went without a hitch. Now I wish to compile and run my first java program I oped up cmd and told it to go to C:\Program Files (x86)\java\jdk1.6.0_18\bin\javac to my first program and It cannot find the javac program and no matter how many different methods I use to tell it to start the javac my computer cannot find the program any ideas?
 
author & internet detective
Posts: 42006
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sam,
Welcome to JavaRanch!

Do you see a file named "javac" in C:\Program Files (x86)\java\jdk1.6.0_18\bin? If so, can you post the command you are running? Or a few of them since you tried different things.
 
sam johnston
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah I see the file there

What I have been doing is C:\Program Files (x86)\java\jdk1.6.0_18\bin\javac Program Files (x86)\java\jdk1.6.0_18\bin\javac and "C:\Program Files (x86)\java\jdk1.6.0_18\bin\javac" the last one actually worked but then I ran into trouble with it finding the .java program I wanted it to compile is there a method where I can make it where I can just issue the javac command then the directory of the .java file I saw that it could be done but I was unable to get it to work correctly and I was wondering if it was a problem with the installation or the fact that im using a 64 bit version of windows?
 
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you sure you installed the JDK and not the JRE? Because you need the JDK.

Edit: to late
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Set your path.
 
Bartender
Posts: 1849
15
Eclipse IDE Spring VI Editor Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why did you install the 32 bit JDK with a 64 bit OS? You might consider uninstalling and reinstalling.

And, yes, I agree with David. You need to set your path. Right click my computer, select properties, select advanced system settings, and click the button that says "environment variables". Add a semicolon and the full directory name to the bin folder inside your JDK install to the PATH textbox.
 
sam johnston
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok I reinstalled JDK (I feel quite dumb for not looking for the 64 bit installer) and I went to set the path and I entered ;C:\Program Files\Java\jdk1.6.0_18\bin and still when I type javac into cmd windows still cannot find the command
 
Janeice DelVecchio
Bartender
Posts: 1849
15
Eclipse IDE Spring VI Editor Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you add it to both the system and user variables? You only need it in the system, but I've seen people put it in both.

Did you reboot?
 
sam johnston
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yea I added it in both and restarted and still nothing
 
Janeice DelVecchio
Bartender
Posts: 1849
15
Eclipse IDE Spring VI Editor Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Alright.... when you try to compile, your command prompt is in the directory of the java file?

That is to say your command looks like this:



What, exactly is in the "system variables / PATH" textbox? If windows is "not recognized command or filename" you might have a typo... copy and paste that entire textbox here
 
Rancher
Posts: 425
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you post here the exact error that you are getting when you try to compile a class?
 
sam johnston
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Its just the 'javac' is not recognized as an internal or external command
 
sam johnston
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
in the system variable path I have

 
Janeice DelVecchio
Bartender
Posts: 1849
15
Eclipse IDE Spring VI Editor Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you have no other paths? Most people have paths to the root and the windows folder... get rid of the semicolon.
 
sam johnston
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My goodness we have success!!@!!1!!!
Thanks all who helped in this simple process gone wrong!
Now if I get anywhere in java programing everyone who helped will be able to say they had a part in the magic
 
Janeice DelVecchio
Bartender
Posts: 1849
15
Eclipse IDE Spring VI Editor Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You'll be back
 
Pushkar Choudhary
Rancher
Posts: 425
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sam johnston wrote:My goodness we have success!!@!!1!!!


Good to see that. And have a good time learning Java!
 
sam johnston
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So true you are! Im trying to compile my second app and I get a error saying an exception in the tread "main and a long list of where the eroor is and then it says it cannot find the class
 
Janeice DelVecchio
Bartender
Posts: 1849
15
Eclipse IDE Spring VI Editor Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sam johnston wrote:So true you are! Im trying to compile my second app and I get a error saying an exception in the tread "main and a long list of where the eroor is and then it says it cannot find the class



Looks like you get to start a new thread!
 
Whoever got anywhere by being normal? Just ask this exceptional tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic