aspose file tools*
The moose likes Beginning Java and the fly likes Trouble installing Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Trouble installing Java" Watch "Trouble installing Java" New topic
Author

Trouble installing Java

Zukias Trunchbull
Greenhorn

Joined: May 03, 2013
Posts: 7
Hi, I'm fairly new to programming, and i've been reading JavaRanch's page on how to install Java (here). I have successfully downloaded "jdk1.7.0_21". I think something is wrong with the path settings, I am using Windows 7 and have gone to advanced system settings and added a system variable "JAVA_HOME" with value "C:\Program Files (x86)\Java\jdk1.7.0_21" and edited the "Path" variable as it tells me to. Then it tells me to open a command prompt and type in "javac-version" to get the version of the SDK, but I get the error: "'javac-version' is not recognised as an internal or external command, operable program or batch file."

Anyone have any idea's what i'm doing wrong?

Any help would be appreciated
pawan chopra
Ranch Hand

Joined: Jan 23, 2008
Posts: 411

I hope you added space between javac and -version. Otherwise just try Javac. Also try to print echo %path% and echo %classpath% see if its correct. I hope you added full path till bin folder in your Path varibale


Pawan Chopra
SCJP - DuMmIeS mInD
Mansukhdeep Thind
Ranch Hand

Joined: Jul 27, 2010
Posts: 1157

Add the location of your /Java/jdk1.7/bin and /Java/jdk1.7/lib also to your path variable. All the binaries are located in the bin folder. Try this and get back.

And a warm welcome to the ranch.


~ Mansukh
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39395
    
  28
Mansukhdeep Thind wrote:Add the location of your /Java/jdk1.7/bin and /Java/jdk1.7/lib also to your path variable. . . .
No, no, no, no, no. Only add the bin folder.
Mansukhdeep Thind
Ranch Hand

Joined: Jul 27, 2010
Posts: 1157

So many "No" s Campbell. Did I say something drastically wrong or irrelevant?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42276
    
  64
Yes.


Ping & DNS - my free Android networking tools app
Mansukhdeep Thind
Ranch Hand

Joined: Jul 27, 2010
Posts: 1157

What is my mistake Ulf? Could you please correct me?
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18896
    
  40

Mansukhdeep Thind wrote:What is my mistake Ulf? Could you please correct me?



Didn't Campbell do exactly that? And pretty emphatically too.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Mansukhdeep Thind
Ranch Hand

Joined: Jul 27, 2010
Posts: 1157

Is adding the lib folder irrelevant in this context or is it counterproductive?
Sharmistha Sarkar
Ranch Hand

Joined: Dec 18, 2012
Posts: 44
bin contains all the binary files like java, javac, and jar which are used by jdk during program compilation and execution.
lib contains all the library functions like API and all packages that are used by either jdk or user. These are the implicit functions or classes that need not be defined before using.
 
wood burning stoves
 
subject: Trouble installing Java