• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Head First Question

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am as new to Java as you can get. Anyway, i just got the Head First java book, and i have a question from the installation instructions...

From the book:

"Once you've downloaded and unpacked, you need to add an entry to your PATH environment variable that points to the /bin directory inside the main Java directory. For example, if the J2SDK puts a directory on your drive called "j2sdk1.5.0", look inside that directory and you'll find the "bin" directory where the Java binaries (the tools) live. That bin directory is the one you need a PATH to, so that when you type %Javac at the command-line, your terminal will know how to find the javac compliler."

First of all, I downloaded the JDK, but i assume that is the same thing as the SDK. My problem is, though, I have no idea what it means by "add an entry to your path environment"... How do I do what this paragraph is telling me to do?
 
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
Welcome to JavaRanch!

Yes, JDK (Java Development Kit) is another name for the SDK (Software Development Kit).

The system PATH variable is a list of different paths. When you type something like "javac" at the command line, your system will check the different paths listed in the PATH variable until it finds the location of "javac." Basically you are telling your computer where to find these tools.

If you are running Windows, see step 4 of Sun's installation instructions for Windows. (If you are not running Windows, let us know.)
 
Drew Sullivan
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wow, fast reply. Thanks.

However, i did just come to a certain realization. I hadn't installed a section of the JDK. However, when i try to, it says that it can't install because it is not compatible with my processor. Can i fix that?
 
marc weber
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

Originally posted by Drew Sullivan:
...I hadn't installed a section of the JDK. However, when i try to, it says that it can't install because it is not compatible with my processor. Can i fix that?


What type of processor and operating system are you running?

What version of the JDK are you installing?

What part of the JDK is not installing, and what are the exact error messages are you getting?
[ February 27, 2008: Message edited by: marc weber ]
 
Drew Sullivan
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay, I have windows xp.

I downloaded the Java 6 Update 4 JDK

I am trying to installing this: jdk-6u4-windows-x64.exe

Lastly, the error massage is: "This installation package is not supported by you processor type. Please contact vendor.
 
Drew Sullivan
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
UPDATE: I have fixed the problem and everything is working fine now.
[ February 27, 2008: Message edited by: Drew Sullivan ]
 
marc weber
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

Originally posted by Drew Sullivan:
UPDATE: I have fixed the problem and everything is working fine now...


That's good to hear!

(I'm guessing the 64-bit version was the problem?)
 
Drew Sullivan
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, that was the problem.

Now, when i copy the 99 bottles of beer code directly from the book and try to compile it, it won't compile because there's 39 problems! I have already complied some things successfully, so im not sure why this one is having so many issues... In the book they say it should compile perfectly, so i don't really understand whats going on here.
 
marc weber
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
Can you post the exact code you're using?
 
Drew Sullivan
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is the code here:



EDIT: Fixed one thing copied wrong.
[ February 28, 2008: Message edited by: Drew Sullivan ]
 
marc weber
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
Hmmm... That compiles and runs fine for me. Can you post the error messages you're getting?
 
Drew Sullivan
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh, wow. I am really sorry for wasting your time. I had it saved as TheBeerSong.java instead BeerSong.

I really appreciate you helping me, so i'll make sure i check a little harder before asking questions. Again, sorry.
 
marc weber
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
 
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
problems like these are common to all beginners. don't let them discourage you!!!

You should be proud that you figured many of these out on your own. many people get frustrated and quit, but you kept at it. that is a great quality for any developer to have.

Congratulation, and welcome to the Ranch!!!
 
Drew Sullivan
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh, im not giving up any time soon. This community is great. See, maybe if I didn't have anyone to help me and got stuck with no one who would answer, then i'd have an issue. I've been to other communities trying to learn various things, and the members are complete jerks to new people. However, here that is obviously not the case.

Now, on the other hand, I just noticed something when going back and reviewing the introduction of this book. It says that is book is for people who have programming experience either in C++, HTML, or anything with looping. The problem is, I don't have any experience in programming at all. None, nada, zlitch. Is that going to be an issue?
 
Marshal
Posts: 79151
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Drew Sullivan:
It says that is book is for people who have programming experience either in C++, HTML, or anything with looping. The problem is, I don't have any experience in programming at all. None, nada, zlitch. Is that going to be an issue?

No
 
marc weber
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

Originally posted by Drew Sullivan:
... It says that is book is for people who have programming experience either in C++, HTML, or anything with looping. The problem is, I don't have any experience in programming at all. None, nada, zlitch. Is that going to be an issue?


I think you'll be fine. Head First Java is the best book I've seen for true beginners. I wish it had been around when I started.
 
Drew Sullivan
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ah, thanks.

That's good to hear!
 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I also started out with no experience (well, save a little HTML, a long time ago) with programming. Picked up Java over the start of the school year and am starting to actually understand it.

It's really not that scary. The first few weeks are horrid, but then you get the basics, and when you understand classes and objects and how they interact then the fun really starts.

Loops are nothing to be intimidated by. All they do is execute the same lines of code over and over so you don't have to re-write every line (extremely useful!)
 
For my next trick, I'll need the help of a tiny ad ...
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic