Java 1.5.0

Discussion in 'Mac Programming' started by d_leet, Jan 4, 2006.

  1. d_leet macrumors newbie

    May 5, 2005
    OK I've searched this forum and apple's site on how to get Java 1.5 working and no matter what I can't get it to be the default java version used. Can someone please tell me what to do? Thank you very much.
  2. bousozoku Moderator emeritus

    Jun 25, 2002
    Gone but not forgotten.
    Other than changing it in Java Preferences within /Applications/Utilities/Java, I don't know. Some applications I've tried won't use it, for whatever reason.

    Attached Files:

  3. d_leet thread starter macrumors newbie

    May 5, 2005
    I just tried that and that doesn't work either, I can't even compile this simple hello world program.
  4. therevolution macrumors 6502

    May 12, 2003
    You're doing this at the command line, right? Here's what I did. I see the Java 5 executables at


    You could make an alias by editing your .bash_profile (located in your home directory; if it's not there, just create it) to include the following:

    alias java5="/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Commands/java"
    alias javac5="/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Commands/javac"
    After closing and reopening your open Terminal window (or typing "source ~/.bash_profile"), you could then type:

    java5 HelloWorld
    If you don't like typing that extra "5" at the end, you can have the alias simply be "java" instead of "java5" - I just prefer not to override the default, but I don't think there's any harm in doing so. You can always go back to the way it was before by removing those lines from .bash_profile.

    You could also skip my instructions and read over this very informative article:

    Hope this helps!
  5. d_leet thread starter macrumors newbie

    May 5, 2005
    Awesome, thank you very much that worked perfectly, and is exactly what I wanted because I was starting to wonder if I could do something like that in order to get this working. Thank you all very much.

Share This Page