Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Installing Java  RSS feed

 
Teny Thomas
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello there everyone, I have recently purchased a book called Head First Java, and in order to learn the language I'm aware that Java needs to be installed on your computer.
I have downloaded and installed the jdk as mentioned in the book, however I am unsure as to how compiling Java works.
a %javac is mentioned but I don't know how it works >.<
It also said something about changing my file Path to point to the \bin directory, but I don't quite understand how it works.
I'm running Windows XP if that helps any.
If you could help me with this, that'd be great.
 
Joseph Kampf
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will need to do something like this either in your command prompt, write an env.cmd that you call ever time you open a command prompt to work on java or you can set these values in your environment variables in the Advanced Tab of the properties of My Computer (Right click on My computer, select properties).

set JAVA_HOME=<Full directory path of your jdk directory>
set PATH=%JAVA_HOME%\bin;%PATH%

You should be able to call javac or java or any of the other java command line tools that come with the JDK.

Joe



Originally posted by Teny Thomas:
Hello there everyone, I have recently purchased a book called Head First Java, and in order to learn the language I'm aware that Java needs to be installed on your computer.
I have downloaded and installed the jdk as mentioned in the book, however I am unsure as to how compiling Java works.
a %javac is mentioned but I don't know how it works >.<
It also said something about changing my file Path to point to the \bin directory, but I don't quite understand how it works.
I'm running Windows XP if that helps any.
If you could help me with this, that'd be great.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch!

Updating the system PATH variable is covered in Step 4 of the Installation Instructions for Windows.

The javac and java commands are used at the command line. In Windows XP, this is under Start > Programs > Accessories > Command Prompt. (You will probably want to make a shortcut for this app.)

To see how to use these, try this Hello World Tutorial for Windows. This will also verify that your installation is correct.
 
Teny Thomas
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, thanks for the information, I have added new variables called PATH (there was previously a "path"), and JAVA_HOME, but that does not resolve my problem.
My book requires J2SE version 1.5 or more, but the only things I can find on the website are 1.4_.... and something called an EE 5 SDK, should this be the one I download?
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is Sun's current Java SE Downloads page. You probably want to download and install JDK 6 Update 2. Be sure to follow the installation instructions.

(SE is "Standard Edition," which you will need. EE is "Enterprise Edition," which you probably do not need.)

What specific problems were you having with the 1.4 installation?
[ August 17, 2007: Message edited by: marc weber ]
 
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!