Page 1 of 2 12 LastLast
Results 1 to 20 of 22
Like Tree1Likes

Thread: Can't find java on macbook pro.

  1. #1
    DesmondD is offline Total beginner
    Join Date
    Feb 2014
    Location
    Hamilton, New Zealand.
    Posts
    27
    Rep Power
    0

    Default Can't find java on macbook pro.

    Thanks to everyone who has helped me so far - I know it must be frustrating guiding total beginners like me but I certainly appreciate the help. :)
    I'm on page 119 of my beginners book for android programming.
    I am now on Mavericks 10.9.1.
    I was operating with 10.6 or something like that and read that apple had their own version of java and it could not be run on this os.
    Last night I downloaded and installed the latest operating system on my 4 year old macbook.
    The strange thing is that Eclipse has found java under 'installed JRE's' but can't seem to run some sample programs I downloaded?

    [2014-02-18 18:51:21 - 14-01] Unable to resolve target 'android-17'
    [2014-02-18 18:51:21 - 11-07] Unable to resolve target 'android-18'
    [2014-02-18 18:51:21 - 13-01] Unable to resolve target 'android-17'
    [2014-02-18 18:51:23 - 05-05] Unable to resolve target 'android-18'
    [2014-02-18 18:51:23 - 04-01] Unable to resolve target 'android-18'
    [2014-02-18 18:51:23 - 11-01] Unable to resolve target 'android-18'
    [2014-02-18 18:51:23 - 11-05] Unable to resolve target 'android-18'
    [2014-02-18 18:51:23 - 11-06] Unable to resolve target 'android-18'
    [2014-02-18 18:51:23 - 10-17] Unable to resolve target 'android-18'
    [2014-02-18 18:51:23 - 12-10] Unable to resolve target 'android-8'

    Or is it simply that it can't find them?

    A different issue is this:
    I can't see java when I go to "Library, plug-ins" because there is only one plug-in there for something else? [Picasa] but according to my computer it is there.
    "18/02/14 7:09:33.794 pm java[728]: objc[728]: Class JavaLaunchHelper is implemented in both /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java and /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/jli/./libjli.dylib. One of the two will be used. Which one is undefined."
    At the moment I am relieved to see that Eclipse lists "Java SE6", as I have restarted my computer and did some 'disc utility' repairs as well, but it's weird that I could not locate the program when I tried to direct Eclipse there.
    I think my first app will be one that allows a person to inflict pain on their computer!

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,435
    Blog Entries
    7
    Rep Power
    20

    Default Re: Can't find java on macbook pro.

    Under the hood the Mac runs a version of Unix (I don't know which one); if you're able to start up a shell, you can do:

    Java Code:
    which java
    If the java executable jvm is somewhere on the path, the 'which' command will find it. If that executable is not on the path, you can do:

    Java Code:
    find / -name java -print
    The 'find' command searches the entire disk for something named 'java' and it'll print the absolute path of the file. Maybe your Mac has the man(ual) pages loaded so you can read the details by doing:

    Java Code:
    man which
    man find
    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    DesmondD is offline Total beginner
    Join Date
    Feb 2014
    Location
    Hamilton, New Zealand.
    Posts
    27
    Rep Power
    0

    Default Re: Can't find java on macbook pro.

    Quote Originally Posted by JosAH View Post
    Under the hood the Mac runs a version of Unix (I don't know which one); if you're able to start up a shell, you can do:

    Java Code:
    which java
    If the java executable jvm is somewhere on the path, the 'which' command will find it. If that executable is not on the path, you can do:

    Java Code:
    find / -name java -print
    The 'find' command searches the entire disk for something named 'java' and it'll print the absolute path of the file. Maybe your Mac has the man(ual) pages loaded so you can read the details by doing:

    Java Code:
    man which
    man find
    kind regards,

    Jos
    Thanks very much - this is what I get:[name edited]
    "Desmond-xxxxxs-MacBook-Pro:~ desmondxxxxxs$ which java
    /usr/bin/java
    Desmond-xxxxxs-MacBook-Pro:~ desmondxxxxxx$
    Desmond-xxxxxs-MacBook-Pro:~ desmondxxxxxx$ find / -name java -print
    find: /.DocumentRevisions-V100: Permission denied
    find: /.fseventsd: Permission denied
    find: /.MobileBackups: Permission denied
    find: /.Spotlight-V100: Permission denied
    find: /.Trashes: Permission denied
    /Applications/adt-bundle-mac-x86_64-20131030/sdk/extras/android/support/v13/src/java
    /Applications/adt-bundle-mac-x86_64-20131030/sdk/extras/android/support/v4/src/java
    /Applications/adt-bundle-mac-x86_64-20131030/sdk/extras/android/support/v4/src/tests/java"

    I've only just learned about the "terminal" which I've never used before :)

  4. #4
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,869
    Rep Power
    5

    Default Re: Can't find java on macbook pro.

    Quote Originally Posted by JosAH View Post
    Under the hood the Mac runs a version of Unix (I don't know which one);
    My memory is tingling, what pops up is that the current releases of MacOS are based on Debian Linux.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  5. #5
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,435
    Blog Entries
    7
    Rep Power
    20

    Default Re: Can't find java on macbook pro.

    Quote Originally Posted by DesmondD View Post
    Thanks very much - this is what I get:[name edited]
    "Desmond-xxxxxs-MacBook-Pro:~ desmondxxxxxs$ which java
    /usr/bin/java
    It is stored where the executables for the user(s) are stored; can you run it? i.e. do this for a small test:

    Java Code:
    java -version
    Do you see its version?

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  6. #6
    mbschutlz97 is offline Member
    Join Date
    Jan 2014
    Posts
    30
    Rep Power
    0

    Default Re: Can't find java on macbook pro.

    have you changed your path variable or do you need to change it?

  7. #7
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,435
    Blog Entries
    7
    Rep Power
    20

    Default Re: Can't find java on macbook pro.

    Quote Originally Posted by mbschutlz97 View Post
    have you changed your path variable or do you need to change it?
    It' on the path otherwise 'which' wouldn't have found it.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  8. #8
    DesmondD is offline Total beginner
    Join Date
    Feb 2014
    Location
    Hamilton, New Zealand.
    Posts
    27
    Rep Power
    0

    Default Re: Can't find java on macbook pro.

    Quote Originally Posted by JosAH View Post
    It is stored where the executables for the user(s) are stored; can you run it? i.e. do this for a small test:

    Java Code:
    java -version
    Do you see its version?

    kind regards,

    Jos
    I typed "java -version" into the terminal. Was I also supposed to type "Java Code:" somewhere?

    Desmond-xxxxxs-MacBook-Pro:~ desmondxxxxs$ java -version
    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)

    When I check Eclipse preferences it tells me that I have Java SE6 in "installed JRE's"
    Last edited by DesmondD; 02-18-2014 at 07:04 PM.

  9. #9
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,435
    Blog Entries
    7
    Rep Power
    20

    Default Re: Can't find java on macbook pro.

    Quote Originally Posted by DesmondD View Post
    Desmond-xxxxxs-MacBook-Pro:~ desmondxxxxs$ java -version
    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)

    When I check Eclipse preferences it tells me that I have Java SE6 in "installed JRE's"
    And it's correct: you have one of the most recent builds of the JVM version 1.6 installed (also see what 'which' found); if you want other JVMs as well, put their directory (folder name) on your path environment variable.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  10. #10
    DesmondD is offline Total beginner
    Join Date
    Feb 2014
    Location
    Hamilton, New Zealand.
    Posts
    27
    Rep Power
    0

    Default Re: Can't find java on macbook pro.

    Quote Originally Posted by JosAH View Post
    And it's correct: you have one of the most recent builds of the JVM version 1.6 installed (also see what 'which' found); if you want other JVMs as well, put their directory (folder name) on your path environment variable.
    kind regards,
    Jos
    Well I've definitely joined the right forum to get friendly help, thank you :)
    I'm pretty new at "working behind the scenes" and used the terminal for the first time yesterday.
    Regarding putting the directory name in the "path environment variable" are you talking about directing Eclipse to the other version or doing something in the computer?
    The strange thing about all of this is that everything you're showing me is telling me that Java is in my library/internet plug-ins but when I actually view that folder all I see is one plug-in for Picasa.
    I'm off to work now - Wednesday morning in NZ - thanks very much for the help. I think basically if Eclipse can see it that is all I need to worry about but there are still those annoying red warnings "unable to resolve target" which I think either means "can't run the program" or "can't find the program" [?]

  11. #11
    DesmondD is offline Total beginner
    Join Date
    Feb 2014
    Location
    Hamilton, New Zealand.
    Posts
    27
    Rep Power
    0

    Default Re: Can't find java on macbook pro.

    Someone suggested that I'm looking in the wrong Library and that I needed to look at the boot disc Library which I did, and found a long list of 'disabled plug-ins'?


  12. #12
    DesmondD is offline Total beginner
    Join Date
    Feb 2014
    Location
    Hamilton, New Zealand.
    Posts
    27
    Rep Power
    0

  13. #13
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,435
    Blog Entries
    7
    Rep Power
    20

    Default Re: Can't find java on macbook pro.

    Not really; those are plugins for your web browser; you want plugins for Eclipse so that you can develop Android stuff with it. If I'm not mistaken Android/Google offers a complete version of Eclipse with all the Android stuff pre-installed; I'd try that if I were you ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  14. #14
    DesmondD is offline Total beginner
    Join Date
    Feb 2014
    Location
    Hamilton, New Zealand.
    Posts
    27
    Rep Power
    0

    Default Re: Can't find java on macbook pro.

    Quote Originally Posted by JosAH View Post
    Not really; those are plugins for your web browser; you want plugins for Eclipse so that you can develop Android stuff with it. If I'm not mistaken Android/Google offers a complete version of Eclipse with all the Android stuff pre-installed; I'd try that if I were you ...

    kind regards,

    Jos
    ok I'm pretty sure I downloaded that package. I think it's time for me to stop worrying about red warning signs concerning stuff I don't know about and start writing basic programs to try and run so I can get started :). What is the best way to save a program so that I can email it to friends to try on their devices? I mainly want to just be able to email a file to my brother [he programs computer games for fun], or copy it onto my tablet just to see it working and know that I can start getting serious.

  15. #15
    DesmondD is offline Total beginner
    Join Date
    Feb 2014
    Location
    Hamilton, New Zealand.
    Posts
    27
    Rep Power
    0

    Default Re: Can't find java on macbook pro.

    ok, I got fed up with all the errors and tried to delete all the Eclipse downloads and start fresh.
    I went to the site for the ADT bundle for mac. I downloaded it and got it running.
    It's now a green icon instead of a purple one and doesn't run as Eclipse, it runs as ADT.
    Obviously I didn't delete enough because the screen is exactly the same as Eclipse and it brought up my previous little program I was playing around with.
    I set up a new virtual device.
    The big problem now is that when I try to "run-as" it says there are no options.

    I've done some searches and none of the fixes are as easy as suggested.
    I somehow found a window that said it couldn't be shown because it is unavailable as a "null" command group or something like that?
    Last edited by DesmondD; 02-20-2014 at 08:27 AM.

  16. #16
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,435
    Blog Entries
    7
    Rep Power
    20

    Default Re: Can't find java on macbook pro.

    Eclipse doesn't know 'as what' it should run something; all you have is a single class (I can see it behind the menu); the simplest solution is to select the 'Run (F11)' option for that class or define a runnable 'configuration' (where you can set many options for the project to run).

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  17. #17
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,869
    Rep Power
    5

    Default Re: Can't find java on macbook pro.

    Probably when you use 'run', it just works. It always has for me when I run something with a public static void main(String[]). And from the first time you do use run, a 'java program' option will appear under 'run as'.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  18. #18
    DesmondD is offline Total beginner
    Join Date
    Feb 2014
    Location
    Hamilton, New Zealand.
    Posts
    27
    Rep Power
    0

    Default Re: Can't find java on macbook pro.

    Quote Originally Posted by JosAH View Post
    Eclipse doesn't know 'as what' it should run something; all you have is a single class (I can see it behind the menu); the simplest solution is to select the 'Run (F11)' option for that class or define a runnable 'configuration' (where you can set many options for the project to run).

    kind regards,

    Jos
    Quote Originally Posted by gimbal2 View Post
    Probably when you use 'run', it just works. It always has for me when I run something with a public static void main(String[]). And from the first time you do use run, a 'java program' option will appear under 'run as'.
    ok thanks, so it's not as messed up as I thought :) I need to run something more substantial. I'll probably get to work on that this weekend because the weather report says we will have some much needed rain in New Zealand :)
    At the moment I'm on page 167 of my book [of 412].
    It is all still very foreign to me but I pick up small bits and pieces of info as I read it and once I start trying to write programs hopefully some of what I've read will be recalled to memory.
    Thanks very much for the help so far :)

  19. #19
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,435
    Blog Entries
    7
    Rep Power
    20

    Default Re: Can't find java on macbook pro.

    And all that mumbo jumbo doesn't make your Java stuff run on an emulator or real device. You have to define an Android project (see File>New>Project ...>Android ...); that's the functionality implemented by that Android plugin for Eclipse ...

    kind regards,

    Jos
    DesmondD likes this.
    cenosillicaphobia: the fear for an empty beer glass

  20. #20
    DesmondD is offline Total beginner
    Join Date
    Feb 2014
    Location
    Hamilton, New Zealand.
    Posts
    27
    Rep Power
    0

    Default Re: Can't find java on macbook pro.

    Quote Originally Posted by JosAH View Post
    And all that mumbo jumbo doesn't make your Java stuff run on an emulator or real device. You have to define an Android project (see File>New>Project ...>Android ...); that's the functionality implemented by that Android plugin for Eclipse ...

    kind regards,

    Jos
    Looking back at the project, that is how I started it. I went to File>New>Project.... then it showed me this screen and I chose the 'android application.
    I suppose I did change it a bit but it ran on the console after each change.


Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 17
    Last Post: 02-23-2014, 08:14 PM
  2. Need protect you MacBook?
    By bababoo in forum Reviews / Advertising
    Replies: 0
    Last Post: 01-12-2011, 04:36 PM
  3. Replies: 27
    Last Post: 06-06-2009, 01:09 AM
  4. Replies: 21
    Last Post: 06-01-2009, 12:52 PM
  5. java:34:cannot find symbol
    By MissyMadi in forum New To Java
    Replies: 5
    Last Post: 11-09-2008, 06:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •