• Post Reply Bookmark Topic Watch Topic
  • New Topic

Whether Java is correctly installed on Windows  RSS feed

 
darren taylor
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all, New to this game. I am using a copy of Head First Java and am already having trouble with the jdk installation. I have installed jdk1.6.0_31 in the c drive: C:\Program Files\Java\jdk1.6.0_31. Then I went to control panel-system properties-advanced system settings-environment variables and set "JAVA_HOME" as the variable and "C:\Program Files\Java\jdk1.6.0_31" as the value and "Path" as the variable and "%JAVA_HOME%\bin;C:\Program Files\Common Files\Microsoft Shared\Windows Live;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Windows Live\Shared" as the value, both under system variables. When I go to command prompt and type "javac-version" I also get the "is not recognised as an internal or external command, operable program or batch file." However, when I type either "java" or "javac" I do get a whole lot of information sent to me. Any ideas?
 
Campbell Ritchie
Marshal
Posts: 56600
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

Please tell us more details. I suspect you have correctly installed Java™, and you are suffering errors because you have not supplied the name of the files to compile/execute. If you have a class Foo in a file Foo.java, which prints Baaa! to screen, you use these commands
  • 1: You need to give the commands in order.
  • 2: Note the .java extension is omitted second time round
  • 3: Advice about making directories can be found here.
  • 4: This FAQ has lots more useful information in
  •  
    Campbell Ritchie
    Marshal
    Posts: 56600
    172
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    It isn’t javac-version. It’s javac -version. Very subtle difference.
     
    William P O'Sullivan
    Ranch Hand
    Posts: 859
    Chrome IBM DB2 Java
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    It's: javac(space)-version

    e:g: javac -version


    c:\Users\osullivanw\workspace\POSpringJPA>javac -version
    javac 1.6.0_23

    *not*

    c:\Users\osullivanw\workspace\POSpringJPA>javac-version
    'javac-version' is not recognized as an internal or external command,
    operable program or batch file.

    WP
     
    Jesper de Jong
    Java Cowboy
    Sheriff
    Posts: 16060
    88
    Android IntelliJ IDE Java Scala Spring
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Mansi: As discussed in your other topic, that error does not have anything to do with the CLASSPATH variable, but with the PATH variable.
     
    darren taylor
    Greenhorn
    Posts: 2
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Campbell Ritchie wrote:Welcome to the Ranch

    Please tell us more details. I suspect you have correctly installed Java™, and you are suffering errors because you have not supplied the name of the files to compile/execute. If you have a class Foo in a file Foo.java, which prints Baaa! to screen, you use these commands
  • 1: You need to give the commands in order.
  • 2: Note the .java extension is omitted second time round
  • 3: Advice about making directories can be found here.
  • 4: This FAQ has lots more useful information in


  • Hi Campbell et al, thanks for your reply. It seems the space before the hyphen was the trick. My next problem is downloading the API. When I go to the following oracle site "http://docs.oracle.com/javase/6/docs/api/" I just get the API webpage, but cannot seem to download it. Any links? Thanks, D
     
    Campbell Ritchie
    Marshal
    Posts: 56600
    172
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    You don’t download the API documentation. You view it on a browser. You can get a version to keep on your PC as a local file from the same page as the downloads by scrolling down. Try here.
     
    With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!