• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Help getting started?

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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'.
 
Sheriff
Posts: 28322
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Getting started with Java on Windows:

http://java.sun.com/docs/books/tutorial/getStarted/cupojava/win32.html
 
Catherine Edwards
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Ranch Hand
Posts: 537
Eclipse IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Catherine Edwards
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Paul - I think this is just what I was looking for... checking it out now
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Catherine Edwards
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!

 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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?
 
Catherine Edwards
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 686
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 686
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Marshal
Posts: 79943
396
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
If you believe you can tell me what to think, I believe I can tell you where to go. Go read this tiny ad!
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic