Help get this topic noticed by sharing it on Twitter, Facebook, or email.

Java JDK version

Hi,

I am following instructions on page 26 of Learning Java 4E. When typed at command prompt:
java -version
It told me:
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)
I went to Oracle site and downloaded and installed JDK 7u45. (I am using macOSX and that's the version I used.) But after installation and rebooting my Mac, the "java -version" returns exactly the same three lines as before the installation.

Would someone please tell me what I must do to get Java 7 (JDK 1.7) to take effect?

Thank you,

Tena Sakai
1 person has
this problem
+1
Reply
  • Hello Tena,

    I have forwarded your question on to our Book Tech staff, so they can help you find a solution. If you ever have any questions or issues with the content of a title, you can also contact them directly at booktech@oreilly.com or call them at:

    1-800-889-8969
    or
    1-707-827-7019 (outside the USA)
    7:30 am to 5:00 PST

    Kind regards,
    Paul Fichera
    Customer Service Representative
    O'Reilly Media
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned happy, confident, thankful, excited sad, anxious, confused, frustrated kidding, amused, unsure, silly

  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned happy, confident, thankful, excited sad, anxious, confused, frustrated kidding, amused, unsure, silly

  • Hi Tena,

    I believe this page will give you the solution to your problem -
    http://docs.oracle.com/javase/7/docs/...

    I hope that helps,
    Chris Olson
    O'Reilly Book Support
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned happy, confident, thankful, excited sad, anxious, confused, frustrated kidding, amused, unsure, silly

  • Hi Chris,

    At the bottom of the link you gave, it says
    "Note that if you install only Oracle Java JRE 7, it will not appear in this list. You must install the full JDK in order for JRE 7 to be listed. "
    That is what I did. But when I navigate to Applications->Utilities folder, there is no such thing as Java Preferences. Would you please comment as to what this means and what the cure might be?

    Thank you.

    Tena
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned happy, confident, thankful, excited sad, anxious, confused, frustrated kidding, amused, unsure, silly

  • Hi Tena,

    If you search in Spotlight (cmd + Shift) for Java Preferences, it should come up. This article also shows how to fix the problem, and might be more clear -
    http://stackoverflow.com/questions/12...

    Best regards,
    Chris Olson
    O'Reilly Book Support
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned happy, confident, thankful, excited sad, anxious, confused, frustrated kidding, amused, unsure, silly

  • Hi Chris,

    I apologize for my slow response, I have been sick. I just read the new link you pointed out for me, but I doubt that's relevant to the problem I am having. (For the purpose of reading and following examples of Learning Java 4E, I don't plan to use command line, but strictly Eclipse. The environment variable they are discussing is to do with command line, I believe.) Before I went down for catching this nasty cold, I googled and found seemingly apropos website and followed what was suggested.


    Sure enough, that fixed the problem I had with Eclipse previously, which is manifest that Eclipse reporting that it is using JavaSE-1.7 and many weired marking of the source code disappeared. But that's not the end of the story. When I hit "Run" button, it tells me "Invalid project specified" with a small panel with a heading of "Problem Launching JUnit Tests." When I close this small panel, then a larger panel entitled "Run Configuration" comes up and I am afraid to tinker because it looks pretty complicated --there are number of pull-down menus on top and four major options on the left side.


    What I decided to do is to remove my Eclipse tree entirely and download a fresh copy. This way I should avoid some inconsistencies out of version complications.
    I should be able to report back later today. Thank you for your help.


    Tena
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned happy, confident, thankful, excited sad, anxious, confused, frustrated kidding, amused, unsure, silly

  • Hi,

    I am spending awfully a lot of time and getting nowhere. Every time I reinstall Eclipse there seems to be a new problem as I start Eclipse. Last a few hours I have been trying to follow what's on pages 28 and 29, Importing the Learning Java Examples.


    What I wind up with is a lot of icons of square in a red box. Almost every line in Package Explorer has such icon, as well as in the pain where a source code Hellojava.java is shown. (Please see attached image file.) The zip file I used is called from a web page https://github.com/patniemeyer/learni... and it is called learningjava-master.zip. I got it by pressing the button Download ZIP at the lower right of the page.


    I am not aware that I am doing anything different from what's described by the two pages of the book. Can anybody please explain what these icons / symbols mean, and, more importantly, what I need to fix what's happening?


    Thank you,


    Tena Sakai
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned happy, confident, thankful, excited sad, anxious, confused, frustrated kidding, amused, unsure, silly

  • Hi Tena,

    Please use the instructions in Appendix A to import the practice files into Eclipse. It's a little more accurate. Also, inside of the zip file, there is a folder called
    Eclipse-Project and that contains a zip file called "examples-eclipse-ch2".

    The problem you are having is most likely because you are importing the whole archive and not just the "examples-eclipse-ch2" zip file.

    Best regards,
    Chris Olson
    O'Reilly Book Support
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned happy, confident, thankful, excited sad, anxious, confused, frustrated kidding, amused, unsure, silly

  • Hi Chris,

    Thanks to your advice, I have made a modest progress. At least I feel I can now move on to follow the book and learn Java, as well as Eclipse. Please see the image below.




    I am happy to concede and accept what you mentioned. Namely, 'The problem you are having is most likely because you are importing the whole archive and not just the "examples-eclipse-ch2" zip file.'

    Still, I am a bit puzzled by those x's in red squares, which appear within the Package Explorer panel of the image I am sending. Would you please tell me what they mean (or give me a pointer)?


    Regards,


    Tena
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned happy, confident, thankful, excited sad, anxious, confused, frustrated kidding, amused, unsure, silly

  • Hi Chris,


    As I read a bit more in appendix and I understand what red x means, just a bit. In the last paragraph of page 902, it says:



    "If there are still some red Xs left, double-click the README-Eclipse.txt file in the project tree to read the latest explanations for these issues."



    But I cannot find this file, README-Eclipse.txt. Would you be so kind and tell me where I can find it?


    Regards,


    Tena
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned happy, confident, thankful, excited sad, anxious, confused, frustrated kidding, amused, unsure, silly

  • Hi Tena,

    I can't find a file with that exact name, but I beiieve that refers to the README file in the "eclipse-project" folder. Also, I read that README and it said to use the examples-eclipse-appa.zip zip file with the instructions in Appendix A, so I'm afraid I misled you with my previous instructions. Sorry about that.

    Best regards,
    Chris Olson
    O'Reilly Book Support
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned happy, confident, thankful, excited sad, anxious, confused, frustrated kidding, amused, unsure, silly

  • Hi Chris,


    I followed your suggestion and tried to import the file you mentioned, examples-eclipse-appa.zip. It wouldn't do it. The 2nd line from the top of attached image seems to tell why it is upset:



    It might be that I need to remove the existing project to pursue reading the appendix A. Which I would like to do, but this brings up a bit sticky point. In the past every time I tried to remove the existing project, something went wrong. What I did was to highlight the project in Package Explorer and Control-click then choose Delete. After I relaunch Eclipse the project was still there. I have also tried what was mentioned in chapter 2 of the book, in the first paragraph on page 27, and removed configuration folder, but, though details escape me now, it was ugly. So, I am reluctant to remove the project as the way I did it before. Would you please tell me a safe and sure way to remove the existing project so that I can do the import with file?


    Regards,


    Tena
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned happy, confident, thankful, excited sad, anxious, confused, frustrated kidding, amused, unsure, silly

  • Hi Tena,

    Here are the instructions for removing a project. Make sure you follow Step 3 as that removes it from your workspace so it will be completely gone -
    http://help.eclipse.org/juno/index.js...

    I hope that helps,
    Chris Olson
    O'Reilly Book Support
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned happy, confident, thankful, excited sad, anxious, confused, frustrated kidding, amused, unsure, silly

  • Hi Chris,


    Thanks for the link. I have decided to keep what I got for a bit longer, since it was meant as examples in chapter 2, I can use it to study materials presented in chapter 2. When I am done with chapter 2, I will follow the instructions from the link you gave me and get examples-eclipse-appa.zip imported.


    Regards,


    Tena
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned happy, confident, thankful, excited sad, anxious, confused, frustrated kidding, amused, unsure, silly