I'm trying to write and run simple code for the first time in java. What exactly do I need to install to do this? I went to java.sun.com, but there are so many downloads to choose from, I really have no idea what I need.
Any help would be appreciated and thanks in advance!
Welcome to the Ranch. Do you remember the downloads page? You want what is called JDK 6 update 4.
Download that to any old folder, install as per usual, and note carefully which folder it goes into. Then follow the instructions for setting the PATH variable. It is usually easiest to set it permanently, at least until update 5 comes out! The path name you want starts with / and ends with /bin on Linux/Unix/Mac and it usually starts with C: and ends with \bin on Windows. If you use Unix/Linux it varies from one installation to another how you update your PATH, and a Google search will be useful for permanent updating, but writing "export PATH=/usr/bin/java/jdk1.6.0_04/bin:$PATH" (or similar) at the beginning of the session usually works.
For the very first application you will probably want a Hello World. There is one in the Java Tutorial here. Follow it closely, and note the "common problems" link. Don't use NetBeans at this stage. Don't use Notepad, a dreadful application, but get Notepad++ or similar for Windows. (If on Linux try gedit or Kate, two excellent editors.)
That should be sufficient to get you writing "Hello Brian" on screen. Good luck.
Are you familiar with Integrated Development Environments?
If so, perhaps you should check out the Eclipse IDE, available for free download.
It will provide you with a free code editor, and will manage the compiles, and you can launch the application from there (optionally in a debugger).
Bill Shirley - bshirley - frazerbilt.com
if (Posts < 30) you.read( JavaRanchFAQ);
Joined: Oct 13, 2005
I agree that Eclipse (and NetBeans) are good products, but I agree with the notion that beginners should be kept well clear of IDEs. Learn to use the command line or shell and a text editor first. And I quite forgot that Java is preinstalled on Macs. Thank you for the reminder.
Joined: Nov 08, 2007
Yes, you CAN get very minimal if you'd like to:
I didn't alter the default paths for the cshell, so the java and javac are already there. (But, of course, Brian hasn't said if he's on a Mac or not)
That should also work on any UniX-ish system That was fun =)
[ February 06, 2008: Message edited by: Bill Shirley ] [ February 06, 2008: Message edited by: Bill Shirley ]
Joined: Feb 06, 2008
I apologize, I did forget to mention that I am running Windows XP.
I followed Campbell Ritchie's steps and everything worked out fine. I was able to follow the installation instructions and run the sample program.
I also want to thank everyone else that posted for taking the time to help me out. I was not expecting such fast and informative replies. I truly do appreciate it! Thank you so so much!!
Thanks, -Brian [ February 06, 2008: Message edited by: Brian Cee ]