*
The moose likes Beginning Java and the fly likes Help getting started? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Help getting started?" Watch "Help getting started?" New topic
Author

Help getting started?

Catherine Edwards
Greenhorn

Joined: Aug 18, 2009
Posts: 6
I've downloaded the Java SDK but I'm not sure exactly what to do to get started practicing with code. I am a total novice (obviously) but am trying to learn how to understand basic programs. Running on Windows... any suggestions on where to start (baby steps appreciated) would be great!
Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
The best possible approach is grabbing a book. I myself prefer that to scraping everything together from 3243 different resources online.

What I can only recommend if you are a starter and are interested in a different learning experience is 'Head First Java'.


JDBCSupport - An easy to use, light-weight JDBC framework -
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Getting started with Java on Windows:

http://java.sun.com/docs/books/tutorial/getStarted/cupojava/win32.html
Catherine Edwards
Greenhorn

Joined: Aug 18, 2009
Posts: 6
I actually do have Head First Java (great book so far - also how I got on this site) and followed their instructions to download the Java SDK. I've got it downloaded but that's where it gets blurry... I've gotten about a chapter and a half past the download instructions and the book now mentions entering code examples into an editor but I can't quite connect the dots... if I'm too clueless, I guess I'll just look at the pictures but would like to be able to type in and test the code examples and maybe one day get to whipping up my own.

Thanks in advance!
Nitish Bangera
Ranch Hand

Joined: Jul 15, 2009
Posts: 537

Well once the installation of the SDK is done, you have to set the path system variable to your jdk/bin. This can be done in the environmental variables. Well i prefer you download Textpad and right the programs there. Also textpad includes the compile and executing if you have already installed the SDK. Cheers have fun javaming.


[ SCJP 6.0 - 90% ] , JSP, Servlets and Learning EJB.
Try out the programs using a TextEditor. Textpad - Java 6 api
Catherine Edwards
Greenhorn

Joined: Aug 18, 2009
Posts: 6
Thanks Paul - I think this is just what I was looking for... checking it out now
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Follow the tutorial to compile and run a "Hello World" program. This will verify that your JDK is installed correctly. Let us know how that goes.


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Catherine Edwards
Greenhorn

Joined: Aug 18, 2009
Posts: 6
I was able to run the "Hello World" app but in order to do so, I had to save the .java file in the /bin folder where my javac is located... couldn't figure out how to get it to work if I save the .java file anywhere else (didn't want to mess around with too much since on my company PC).

I think I'm good for now - thanks for everyone's help - I'm sure I'll be back as I get further along in the book!

Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

Catherine Edwards wrote:I was able to run the "Hello World" app but in order to do so, I had to save the .java file in the /bin folder where my javac is located...

Don't do that. The bin directory of the JDK is for the JDK binary files and other stuff that belongs to the JDK. You should not save your own files there.

Can't you just store your files somewhere under "My Documents"? Where do you normally save files when you work with your computer?


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Catherine Edwards
Greenhorn

Joined: Aug 18, 2009
Posts: 6
I tried saving the .java doc to my desktop but I got the following error:

"javac is not recognized as an external or internal command" - someone in the discussion attached to the Hello World app link had the same problem and indicated that this fixed it so I tried and it worked. If you have any other suggestions I'm willing to try.

Already tried navigating to My Computer > Properties > Advanced Settings > Environment Variables > System Variables and adding the path to the bin folder where my javac is located to the "path" but that didn't seem to change anything.
Fred Hamilton
Ranch Hand

Joined: May 13, 2009
Posts: 679
Catherine Edwards wrote:I tried saving the .java doc to my desktop but I got the following error:

"javac is not recognized as an external or internal command" - someone in the discussion attached to the Hello World app link had the same problem and indicated that this fixed it so I tried and it worked. If you have any other suggestions I'm willing to try.

Already tried navigating to My Computer > Properties > Advanced Settings > Environment Variables > System Variables and adding the path to the bin folder where my javac is located to the "path" but that didn't seem to change anything.


the directory that contains javac.exe should be in your path statement. Do you know how to edit the path?

oops I see you tried adding the bin folder to the path, ok not sure what is wrong then. Maybe the syntax rules of the path statement were violated. When I go to a command prompt and type path, it looks something like this...

C:\uuuq\test1\fchess>path
PATH=D:\WINDOWS\system32;D:\WINDOWS;D:\WINDOWS\System32\Wbem;D:\Program Files\Co
mmon Files\Adaptec Shared\System;D:\Program Files\Java\jdk1.6.0_14\bin
Catherine Edwards
Greenhorn

Joined: Aug 18, 2009
Posts: 6
I followed the instructions in the discussion forum attached to the Hello World App link and added the path to my "bin" within the system variables but didn't insert a semicolon between the last path and the path to the "bin" when I did it... I just updated it to include the ";" and it now works fine. I've removed the HelloWorldApp.java file from my "bin" folder so I think I should be ok... thanks for prompting me to look at it again!
Fred Hamilton
Ranch Hand

Joined: May 13, 2009
Posts: 679
Catherine Edwards wrote:I followed the instructions in the discussion forum attached to the Hello World App link and added the path to my "bin" within the system variables but didn't insert a semicolon between the last path and the path to the "bin" when I did it... I just updated it to include the ";" and it now works fine. I've removed the HelloWorldApp.java file from my "bin" folder so I think I should be ok... thanks for prompting me to look at it again!


cool! I am going to nitpick about language. You aren't adding the path to your bin, you are adding the bin to your path. Obviously you know how to fix the path now, just not describe it properly. Sorry for being pedantic.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38075
    
  22
She's bin up the path and she's bin down the path. Is that what you are trying to say?
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

Catherine Edwards wrote:I tried saving the .java doc to my desktop but I got the following error:

"javac is not recognized as an external or internal command" - someone in the discussion attached to the Hello World app link had the same problem and indicated that this fixed it so I tried and it worked. If you have any other suggestions I'm willing to try.

Well, saving your source files in the JDK's bin directory is not the right solution to this problem.

Already tried navigating to My Computer > Properties > Advanced Settings > Environment Variables > System Variables and adding the path to the bin folder where my javac is located to the "path" but that didn't seem to change anything.

Did you check if you did that exactly right? Step 4 of the JDK installation instructions explains exactly how to set the PATH. Note that you must close and re-open the command prompt window for this to take effect!

If you don't set the PATH, you can still compile and run Java programs, but you'll just have to specify the full path to the Java compiler on the command line, for example:

C:\> "C:\Program Files\Java\jdk1.6.0_16\bin\javac" MyProgram.java
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help getting started?
 
Similar Threads
quick question on DB2 JDBC encoding
Submitting a form on pressing Enter key
Anyone preparing for the exam currently??
JSP and Servlet Specs
SCEA (Part I) 89%