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?
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.
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?
Are you sure you installed the JDK and not the JRE? Because you need the JDK.
Edit: to late
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
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.
When you do things right, people won't be sure you've done anything at all.
sam johnston
Greenhorn
Joined: Feb 08, 2010
Posts: 14
posted
0
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
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
you have no other paths? Most people have paths to the root and the windows folder... get rid of the semicolon.
sam johnston
Greenhorn
Joined: Feb 08, 2010
Posts: 14
posted
0
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
sam johnston wrote:My goodness we have success!!@!!1!!!
Good to see that. And have a good time learning Java!
sam johnston
Greenhorn
Joined: Feb 08, 2010
Posts: 14
posted
0
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
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