I am trying to setup Android Studio on my Mac. It is running OSX 10.9.1 Mavericks. I have installed the latest JDK (at the time of writing 1.7 update 45), and I installed Android Studio. I use Java 7 because I have some Java applications I have to run and they require 1.7. I have not installed Java 1.6, because it is ancient and old. Launching Android Studio from any launcher does literally nothing. Activity Manager never shows it running. I do not want to install Java 1.6.
I did some work and tried to run the executable via command line through the package contents, and for both executables, I get these messages:
I am unsure what I am supposed to do to fix this error. I'm not very adept on a Mac (still somewhat new to it, and its confusing to do power user stuff on this) so if anyone can help me figure it out that'd be great. I'm on the 2013 Macbook Air with plenty of resources for this to run.
Update: This also applies to Yosemite, El Capitan, and all the other versions of OSX that can run Android Studio.
Update 12/11/2014
As of Android Studio 1.0 RC3 you can follow this set of directions to make it work.
I figured it out. You have to edit the android studio's Info.plist file in the package so it uses 1.7. I don't get why Android Studio insists we install and use an outdated, vulnerable version of Java.
Full resolution: http://i.stack.imgur.com/yyYaG.png
To open the package you need to find the Android Studio.app file in the Applications folder and right click it > Show Package Contents.
Edit the plist (I think you might need to be root) and change JVMVersion from 1.6* to 1.7* (or 1.8*, or whatever JDK major version you have). I don't get why that made a difference since my original output said it was using 1.7 anyways.
This fix seems to apply to all of IntelliJ's IDEs (I've seen it on PyCharm as well), though other ones seem to support newer versions of java natively.
As answered by hasternet # Android Studio was unable to find a valid Jvm (Related to MAC OS)
For quick and dirty solution, Follow the answer by Mgamerz; open Android Studio in Finder (CTRL+Click > Show Package Contests > Contents > info.plist) and edit Key JVMOptions>JVMVersion from "1.6*" to "1.6+"
Recommended method as discovered by Antonio Jose is to edit environment variables in MacOS (messing with info.plist is not recommended)
either at program launch (opening the Studio through terminal rather than the icon)
$ export STUDIO_JDK=/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk
$ open /Applications/Android\ Studio.app
or setting up the environment through AppleScript at every MacOS startup:
do shell script "launchctl setenv STUDIO_JDK /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk"
do shell script "launchctl setenv STUDIO_PROPERTIES /Users/username/Library/Preferences/AndroidStudio/idea.properties"
do shell script "launchctl setenv STUDIO_VM_OPTIONS /Users/username/Library/Preferences/AndroidStudio/studio.vmoptions"
(Remember to save the script as Application. Antonio Jose managed with just the first line - AFAIK you can use .properties and .vmoptions to set up additional settings.)
Official instructions: http://tools.android.com/tech-docs/configuration/osx-jdk
(The reason why Android Studio want's to run off of JRE 1.6 is because it apparently makes the fonts look better - feel free to go through that "official" route and install JRE 1.6 # http://support.apple.com/kb/DL1572 - you can then set the JDK to 1.8 in the SDK Location settings - local.properties)
mgamerz is right - The release notes give a much better solution for rc3 and onwards - theres a idea.properties file
(or environment variable)
~/Library/Preferences/AndroidStudio/idea.properties
it also shows what environment variables you can use to set things like the jdk
export STUDIO_JDK=/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk
ref : http://tools.android.com/recent/androidstudio1rc3_releasecandidate3released
I did below command on Mac Terminal to fix this problem, please make sure java version and path.
$java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
$ export STUDIO_JDK=/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk
$ open /Applications/Android\ Studio.app
Hey Friends I just Figured it out a simple way to fix this for Mac users.
Open Terminal and type this -> java -version and hit enter.
Output will be something like this:
Now check your Java Version. My Java version is 1.8
So now we need to Open Contents of our Android App.
For that right click the Android.app and then select Show Contents
Like this
Now there will be Content folder, Open that Folder and there you will find Info.plist
Open this info.plist
And you will see this.
In this expand the JVM
Here you will see the JVM version showing 1.6* but our jvm version is 1.8 (for example my jvm version is 1.8)
So we need to change this number according to our jvm version, so i changed it to version 1.8*
Then click save. And you are done.
Now you will see setup wizard running
And you are ready to start your first android programming app.
Here is the Whole Docx file for Android Studio Setup in Mac X
LINK: https://www.dropbox.com/s/9jwjebn5hgydyll/Android%20Studio%20Setup%20on%20Mac.docx?dl=0
I found that downloading an extra Java bundle from Apple fixed the issue.
If you search for this problem then I found the second link was to a blog having exactly this problem, all credit goes to him here
I know that posting links isn't an answer but as you can see from the resolution you need to make sure you have an up to date version of Java and also the Java bundle from Apple, for this reason I have also included the searches needed to get to these websites.
Here is where to download the latest version of Java
If this link is broken then searching "java latest version" return it at the top of the Google list
Here is where to download the Apple Bundle
If this link is broken then searching "Java for OS X 2014-001" returns it at the top of the Google list
For me trying to solve this problem it appears that initially it was an issue that required a work around and then Apple released an official work around download meaning that fiddling in plists is not necessary any more.
Related
I have formatted my Mac due to some storage issues. Before this, I used Eclipse in a proper way. Now i have installed the JDK
Then, i have installed Java
Until now everything seems to be correct but when I open the Eclipse installer...
What can I do to fix this? I need to work with this the soon as possible.
Thanks
Eclipse on macOS will not start with Java 14 installed, this is being tracked in Eclipse bug 561273.
Installing Java 8 as well does not help. You need to remove the Java 14 install. You could use the Java 13.0.2 release instead.
Eclipse have determined that the root cause of this issue is a change in Java 14 which is described in this bug report JDK-8238225. The fix for this should be in Java 14.0.1
Update: Eclipse runs fine with Oracle Java 14.0.1 so the issue has been fixed.
I also asked this question which was closed, that's why I answer what I have found out: Eclipse will not install on Mac OS Catalina 10.15.4, saying the above error message
Failed to create the Java Virtual Machine.
Deinstalling jdk and install an older one wouldn't help on its own because Eclipse is refusing to install in the first place (as mentioned above). What I have done:
i´ve installed an JDK with boost (you can try several, mine worked with Version 13)
I edited the installer:
Download the dmg file
convert the dmg-file with "hdiutil convert /dev/disk3s1 -format UDRW -o devimage"
mount the converted dmg-file with: "hdiutil attach -owners on devimage.dmg -shadow"
Edit the /Volumes/Eclipse/Eclipse.app/Contents/Info.plist: there is a section which is commented and there you can try the jdk version. You have to give the full path to the java executable, for example:
<string>-vm</string><string>/Library/Java/JavaVirtualMachines/jdk-13.0.2.jdk/Contents/Home/bin/java</string>
Then my eclipse started from the (already) mounted Eclipse image without complaining
I had the same issue myself a while back. In your Eclipsepedia it provided an example of what the eclipse.ini file looks like when your trying to specify a JVM. So just change the eclipse.ini file and then make sure that you have all of the correct documents in that path to match the example.
Still trying to get Eclipse IDE to work and running into Incompatible JVM error. I followed the steps here: I installed Java 7 but Eclipse keep saying that 1.6 is not suitable for this product
But unfortunately to no effect. Running OSX 10.9.5 and uninstalled the out-of-the-box version of Mac. The new version of Java seems to show up in the System Preferences. Please see attached screen capture. I've even done some of the basics like restart my computer, etc. Maybe there are other modifications I need to make to other files. I'm comfortable with Terminal but new to Eclipse and Java.
I have had the same problem as noted above. I could not get Eclipse to install because of Java incompatibilities. The sequence I followed goes like this:
Upgraded to MAC OS Sierra
Downloaded the Eclipse installer but was prompted that I needed to instal a legacy Java.
Installed Java 1.6
Was unable to install Eclipse and was prompted that I needed Java 1.7 or greater. Downloaded and installed Java 1.8
Ran the terminal code 'java -version' // this will check your jre version. This showed returned Java 1.6 despite the fact that I had upgraded to 1.8. The Java version listed in the Java control panel said 1.8
Tried multiple downloads of eclipse and Java and multiple restarts always with the same result.
Visited the Oracle web page noted above:
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html I could not find the above reference to 8u73 and 8u74 but I did find and option to download 1.8.0_12. I did this. It installed without difficulty, and then I was able to install Eclipse without difficulty.
This took hours of my time. I hope this proves useful.
OK, so I don't really know what the problem was, but I simply fixed it by navigating to here http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html and installing 8u74 instead of 8u73 which is what I was prompted to do when I would go to "download latest version" in Java. So changing the versions is what did it in the end. Eclipse launched fine, now. Thanks for everyone's help!
edit: Apr 2018- Now is 8u161 and 8u162 (Just need one, I used 8u162 and it worked.)
JRE is a Run-Time Environment for running Java stuffs on your machine. What Eclipse needs is JDK as a Development Kit.
Install the latest JDK (and not JRE) from http://www.oracle.com/technetwork/pt/java/javase/downloads/jdk8-downloads-2133151.html and you should be good on Mac!
Open up terminal and check what java version is currently set in your path variable.
You can do that by typing in your terminal
java -version // this will check your jre version.
javac -version // this will check your compiler version
If this shows incorrect java version but you have installed java 1.8 then you have to set path variable to the newer version of java.
To do that do add the line:
export JAVA_HOME=/path/to/java/jdk1.x
to ~/.bash_profile (same as /Users/username/.bash_profile)
Then do this from the terminal to set the new variable
source ~/.bash_profile
Also what's your eclipse.ini set to ?
-Dosgi.requiredJavaVersion=1.7
EDIT:
Please open up terminal and type
find / -name "java" // This should find all folder named java on your file system.
Also how did you install java in the first place ?
Echoing the answer, above, a full install of the JDK (8u121 at this writing) from here - http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html - did the trick. Updating via the Mac OS Control Panel did not update the profile variable. Installing via the full installer, did. Then Eclipse was happy.
Here are steps:
download 1.8 JDK from this site
install it
copy the jre folder & paste it in "C:\Program Files (x86)\EclipseNeon\"
rename the folder to "jre"
start the eclipse again
It should work.
For some weird reason "Java SE Development Kit 8u151" gives this trouble. Just install, "Java SE Development Kit 8u152" from the following link-
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
It should work then.
I am unable to start my Android Studio for Android development on Mac OS (10.10.1 - Yosemite)
Open the application package for Android Studio in finder, and edit the Info.plist file. Change the key JVMversion. Put 1.6+ instead of 1.6*. That worked for me!.
Edited:
While this was necessary in older versions of Android Studio, this is no longer recommended. See the official statement
"Please note: Do not edit Info.plist to pick a different version. That will break not only the application signature, but also future patch updates to your installation."
Antonio Jose's answer is the correct one.
Thanks aried3r!
Just install this guy here
http://support.apple.com/kb/DL1572?viewlocale=en_US&locale=en_US
and you should be good.
[Update]
This is fixed in Android Studio 1.1
https://issuetracker.google.com/issues/37015035
In the next version of Android Studio, if no java 6 is found but 7 (or greater) is found then it will use that instead. We still recommend running studio with Java 6 due to improved font rendering, but there is no work around needed if, for example, only java 8 is found.
[End Update]
From Android Studio 1.0 RC3 Notes
As of RC 3, we have a better mechanism for customizing properties for the launchers on all three platforms. You should not edit any files in the IDE installation directory. Instead, you can customize the attributes by creating your own .properties or .vmoptions files in the following directories. (This has been possible on some platforms before, but it required you to copy and change the entire contents of the files. With the latest changes these properties are now additive instead such that you can set just the attributes you care about, and the rest will use the defaults from the IDE installation).
However there is no explanation about what options are.
After searching a little I found this
Adjusting VM Options for Android Studio on Mac
IntelliJ IDEA 14.0.0 Web Help/File IDEA.Properties
However no luck with that.
Fortunately I was able to resolve it on Yosemite using environment variables as said in the 1.0 RC3 Release Notes.
You can also place use environment variables to point to specific override files elsewhere:
STUDIO_VM_OPTIONS, which vmoptions file to use
STUDIO_PROPERTIES, which property file to use
STUDIO_JDK, which JDK to run studio with
This was a little tricky because Android Studio is not a command line application so I had to use a AppleScript command to set the environment variable when login. More info here
This is my launchctl command for the command line.
launchctl setenv STUDIO_JDK /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk
And this my AppleScript (remember to save it as an Application)
do shell script "launchctl setenv STUDIO_JDK /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk"
About launchctl, see here
Note that this last variable allows you to for example run Android Studio with Java 7 on OSX (which normally picks Java 6 from the version specified in Info.plist):
$ export STUDIO_JDK=/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk
$ open /Applications/Android\ Studio.app
Worked for me
Change this key in the Info.plist
I changed from
<key>JVMVersion</key>
<string>1.6*</string>
to
<key>JVMVersion</key>
<string>1.8*</string>
and it worked fine now..
Edited:
Per the official statement as mentioned above by hasternet and aried3r, the solution by Antonio Jose is correct.
Thanks!
As a novice user it took me a while to understand how to fix this in a correct way. After searching and understating many answers on SO I came out with the Following steps that you need to follow to fix the issue.
Please Note:
Although the simplest solution is to update the Info.plist of android studio . But it is not recommended and not the correct way to fix it .
Official statement- "Please note: Do not edit Info.plist to pick a different version. That will break not only the application signature, but also future patch updates to your installation."
First Solution : If you run your Android Studio from command line, you can add these two lines into your .bash_profile
$ export STUDIO_JDK=/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk
$ open /Applications/Android\ Studio.app
From next time whenever you open your terminal your studio will start automatically.
Second Solution: If you want to run Android Studio from UI(by click on Icon) follow below steps:
Open script editor on mac(one can find it in spotlight)
Copy past the below line
do shell script "launchctl setenv STUDIO_JDK /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk"
Note :- Change the jdk version according to your version. To check which version you are using open terminal and run the following command
java -version
3.Now save (⌘+s) as File format: Application. Finally open System Settings → Users & Groups → Login Items and add your new application that you have just created.
Log-off and login again or you can run that application manually as well..
woolaaaa…Its done.
References :
Antonio Jose's answer
ruario's answer
I am using Mac OS X 10.10 also. And to fix this problem.
Open Android Studio application package content (by right click on Android Studio icon in Application folder)
Open file Infor.plist
Search and replace:
<key> JVM version</key>
<string>1.6*</string>
replaced by:
<key> JVM version</key>
<string>1.6+</string>
That's it!
On Mac OS X Yosemite just install:
Java SE Development Kit 8
and
Java Version 8 Update 25
It's all, work for me!
Install newest JDK (8u102 current)
Set envirionment variable STUDIO_JDK (java_home outputs the Java home dir and sed strips two folders to get the jdk dir)
launchctl setenv STUDIO_JDK `/usr/libexec/java_home -version 1.8 | sed 's/\/Contents\/Home//g'`
Launch Android Studio like you would normally
Set STUDIO_JDK on every reboot
The above steps only works for the current session. Here is how to create a plist file in /Library/LaunchDaemons that runs the above command on every boot:
sudo defaults write /Library/LaunchDaemons/com.google.studiojdk Label STUDIO_JDK
sudo defaults write /Library/LaunchDaemons/com.google.studiojdk ProgramArguments -array /bin/launchctl setenv STUDIO_JDK `/usr/libexec/java_home | sed 's/\/Contents\/Home//g'`
sudo defaults write /Library/LaunchDaemons/com.google.studiojdk RunAtLoad -bool TRUE
Found out about the plist trick thanks to http://www.dowdandassociates.com/blog/content/howto-set-an-environment-variable-in-mac-os-x-launchd-plist/
On Android Tools Project Site, there is a great explanation Mac OSX JDK Selection. It fixed my problem. In summary:
Android Studio requires two different JDKs:
The version of Java that the IDE itself runs with.
The version of the JDK that it uses to get the Java compiler from
These two can be (and usually are) the same, but you can configure
them individually. And on OSX in particular, they will often be
different.
and for Yosemite (Mac OSX 10.10) Issues:
First, please make sure that you have the latest version of Java 6
installed; in some cases that has fixed the problems:
http://support.apple.com/kb/DL1572
If not, try running a recent version of Java 7 or Java 8 instead by
setting STUDIO_JDK as described above. That is reported to have fixed
the other problems (though you will get the font rendering shown for
Java 8 above.)
Java was uninstalled when I updated to OS X El Capitan.
See screenshot of terminal before and after I reinstalled Java.
To reinstall Java I followed this link that was provided in the Android Studio dialog box.
Android Studio ran again after the Java installation was reinstalled.
Edit the android studio's Info.plist file in the package so that it uses 1.7 or whatever JVMVersion you have installed. Changing the JVMVersion to 1.6+ instead of 1.6* as hasternet answered above should work too.
The above works but is not recommended see RC3 Release Notes
As of RC 3, we have a better mechanism for customizing properties for
the launchers on all three platforms. You should not edit any files in
the IDE installation directory. Instead, you can customize the
attributes by creating your own .properties or .vmoptions files in the
following directories. (This has been possible on some platforms
before, but it required you to copy and change the entire contents of
the files. With the latest changes these properties are now additive
instead such that you can set just the attributes you care about, and
the rest will use the defaults from the IDE installation).
see Android Studio failed to load JVM on Mac OSX (Mavericks)
I have same problem and fixed with this way:
You should install Java from Official Apple page.
http://support.apple.com/kb/DL1572
This one work for me, very simple, just export the environmentable var. but make sure u have the valid JVM first though.
https://code.google.com/p/android/issues/detail?id=82378
On Mac OS X Yosemite just install:
Java SE Development Kit 8
and
Java Version 8 Update 25
It's all, work for me too! like gehev said , so simple !
You can implement the STUDIO_JDK solution using your user's launch agents. This involves creating one plist file in your LaunchAgents directory, located at ~/Library/LaunchAgents
Create a new file, ~/Library/LaunchAgents/UNIQUE_KEY.plist, where UNIQUE_KEY is just an identifier. I use com.username.androidstudio.
Copy the following text into your new plist file and modify it according the instructions below.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>UNIQUE_KEY</string>
<key>ProgramArguments</key>
<array>
<string>sh</string>
<string>-c</string>
<string>launchctl setenv STUDIO_JDK /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
You will need to make two modifications:
Change UNIQUE_KEY to match your filename (without the .plist extension).
Verify your JDK path is correct and change if necessary. I'm using 7u71 in this example.
This is the same underlying solution as Antonio Jose's answer. It sets the STUDIO_JDK environment variable based on the Android Studio version 1.0 RC3 release notes. This solution uses the LaunchAgents directory rather than AppleScript to set the environment variable. As such it is mostly a difference in how your order and organize your system and environment variables.
Do not edit the plist. These instructions worked for me the first time I installed Android Studio a few months ago as well as just today. (1/21/2015)
All you need to do is a few simple things, although they aren't really listed on Google's website.
First you need Java installed. this is not the JDK, it is seperate. You can get that from this link. If you don't have this it will probably throw an error saying something like "no JVM installed."
Second you need the Java JDK, I got JDK 7 from this link. Make sure to choose the Mac OS X link under the Java SE Development Kit 7u75 heading. If you don't have this it will probably throw an error saying something like "no JDK installed."
If you haven't already installed Android Studio, do that. But I'm sure you've already done that by now.
As #Gerard suggested, I summerise my original comment (https://stackoverflow.com/a/27370525/763459) as an Answer, hope it can help others who are annoyed by this issue.
There's a way without running the AppleScript:
edit .bash_profile (if this file doesn't exist, please create a new one , as #Gerard suggested, you can to use source .bash_profile for the first time).
Install the legacy Java (may be neccessary) http://support.apple.com/kb/DL1572
Put export STUDIO_JDK /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk
Then quit terminal (or any text editors you're using to edit this file), run the Android Studio and viola
Tested with OSX 10.10 and Android 1.0.1
Android Studio will read settings from the file ~/Library/Preferences/AndroidStudio/idea.properties. I created this file and in it have the path to my jdk :
STUDIO_JDK=/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk
No editing of the Info.plist necessary!
"On Mac OS, run Android Studio with Java Runtime Environment (JRE) 6 for optimized font rendering. You can then configure your project to use Java Development Kit (JDK) 6 or JDK 7."
This was listed in http://developer.android.com/sdk/index.html under the system requirements for Mac OS X.
Once you install Java 6 (not the JDK) from Apple as per Alonso C. Licks, you should be able to open Android Studio and reconfigure as you wish without having to mess around in the terminal, info.plist file, or other libraries.
I have downloaded Intellij Idea. When I try to install Intellij, a pop-up appeared that my Mac is missing with Java RE, do you want to download it? After I downloaded missing package using Intellij, I could open Android Studio.
I resolved this issue by changing the JVM version in the Info.plist file to 1.7*
I ran this bad boy:
launchctl setenv STUDIO_JDK /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/
i'm dealing with the same problem and i get it worked.
it is probably that your jdk version is not right.
now i installed jdk1.8 and it is ok now.
For those who were having trouble creating a script that launched on startup, as an alternative you can add this .plist to your LaunchAgents folder. This may be a more appropriate way of adding environment variables to the system since Yosemite decided to do away with launchd.conf. This should also work across user accounts due to the nature of the LaunchAgents folder, but I haven't tested that.
To do this, create a .plist file with the following name and path:
/Library/LaunchAgents/setenv.STUDIO_JDK.plist
and the contents:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>setenv.STUDIO_JDK</string>
<key>ProgramArguments</key>
<array>
<string>sh</string>
<string>-c</string>
<string>
launchctl setenv STUDIO_JDK /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk
</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>ServiceIPC</key>
<false/>
<key>LaunchOnlyOnce</key>
<true/>
<key>KeepAlive</key>
<false/>
</dict>
</plist>
Then change file properties by running the following commands in Terminal:
sudo chmod 644 /Library/LaunchAgents/setenv.STUDIO_JDK.plist
sudo chown root /Library/LaunchAgents/setenv.STUDIO_JDK.plist
sudo chgrp wheel /Library/LaunchAgents/setenv.STUDIO_JDK.plist
Notes:
1) You may need to change 'jdk1.8.0_25.jdk' to match the version that you have on your computer.
2) I tried to use "jdk1.8.*.jdk" to try and account for varying Java * versions, but when I opened Android Studio I got the no JVM error even though if you run "echo $STUDIO_JDK" it returns the correct path. Perhaps someone has some insight as to how to fix that issue.
Try downloading the Java from Apple Support Page: http://support.apple.com/kb/DL1572 if that doesn't work for you or fails to load (very common issue), just follow this link to download and install the Java version you need:
http://support.apple.com/downloads/DL1572/en_US/JavaForOSX2014-001.dmg
That's it.
I had previously uninstall Java 6 and install Java 7, Android Studio was working okay, then I upgraded Android Studio and I had the issue everyone is having. Today, I uninstalled Java 7 and installed Java 8 from Oracle. Then I uninstall Android Studio and installed the latest. Everything is working for me now
I was able to get it to work by editing the info.plist changing 16* to 16+. Tried using the recommended method but that failed.
I downloaded Eclipse (specifically that for C/C++ Programming) for Mac, running OSX Mavericks. When I try to start Eclipse, it gives me this message: "Version 1.6.0_65 of the JVM is not suitable for this product. Version 1.7 or greater is required", and it doesn't open. I installed Java version 7, but nothing changed. I don't know how else to update the JVM (I don't know much about Java in general).
I downloaded the 64-bit version for my MacBook Air, if that matters.
Simply Install the JDK 7 or JDK 8, and not just the latest JRE.
Run whereis java in a Terminal. It will normally display something like /usr/bin/java.
Now run java -version. It shows you 'java version 1.6.0_65' or something approaching. This is because Java 7 does not replace Java 6. Java 7 is installed as an Internet Plug-in and can be found in /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java.
What you need to do is to symlink /usr/bin/java to /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java.
Restart Eclipse, or reboot your computer (I don't know how Eclipse manages this), and it should do the trick. :)
I went to oracle downloads and the scrolled one of the several Mac osX links and downloaded jdk-8u73-nb-8_1-macosx-x64.dmg from oracle and that fixed the problem. I don't know why updating java doesn't do the trick.
add this script into 'eclipse.ini' at the top
'/Library/java/JavaVirtualMachines/jdk1.8.0_77.jdk/contents/Home/bin'
Trying to install eclipse, I installed java version 1.6.0_65 as it requested yet still was blocked from finishing the Eclipse install with the error that I needed 1.7 JVM or higher - not true, installing higher didn't work either. I tried installing jdk-8u101-macosx-x64.dmg and that didn't work. So, I tried JDK 7 as advised, sorry no good.
So, to get the Eclipse installer to run with out that java error I had to edit the Info.plist inside the Eclipse Installer. Right click the Eclipse installer and show package contents, then open info.plist in textEdit.app
(Note: So after several tries editing this plist and following methods mentioned elsewhere nothing worked, I found that you have to use the symlink or java alias because java is installed differently now a days as an internet plugin.)
Where you want to make an edit (You should probably Backup the original or you can download it again), under <key>Eclipse</key>, then <array>, delete out what's there and add <string>-vm</string> and this string underneath; <string>/usr/bin/java</string>
Here is what mine looks like.
<key>Eclipse</key>
<array>
<string>-vm</string>
<string>/usr/bin/java</string>
<string>-keyring</string>
<string>~/.eclipse_keyring</string>
<string>-showlocation</string>
</array>
Then save and try running your eclipse installer; this worked for me.
Just running the below command from there terminal worked for me.
brew cask install java
It updated my idk with 1.8, and after that eclipse opens successfully.
Installed Java SE 1.7.0u10 from Oracle w/ their installer package
Downloaded and unpacked Eclipse Juno (4.2.1)
Double click Eclipse purple icon and get OS X alert prompt with error message:
To open "Eclipse," you need a Java SE 6 runtime. Would you like to
install one now?
(in terminal) which java - /usr/bin/java
ls -l /usr/bin/java - /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java
(in Finder) Double click eclipse alias (included when unpacked download) - Terminal launches, /Applications/Eclipse/Eclipse.app/Contents/MacOS/eclipse ; exit ; and Exclipse launches without OS X alert prompt.
I've tried modifying the Eclipse app bundle plist to point the -vm key to /System/Library/Frameworks/JavaVM.frameworks/Versions/Current/Commands/java, but I feel like I probably shouldn't have to do this.`
I'd like to know how to get Eclipse to launch by just double clicking on the Application package. It's such a small thing to bug me... :o)
The best answer is to fix the Java 7 installation as shown here :
https://stackoverflow.com/a/19594116
Simple to do and I have confirmed it works on Mavericks. With this fix, you can launch your app from the launchpad as usual. If you upgrade your JDK, you will have to reapply the fix to the new installation.
I had JDK 7 installed and I solved this issue for eclipse Kepler by running eclipse from the terminal instead of the finder.
./eclipse
Just thought to share.
Update 1
For the sake of completeness, if you want to run it from Finder as well, you can wrap the ./eclipse command into a .command file and run it from Finder (so that you don't have to open a terminal)
The following lines should do the job (don't forget to replace "your-full-eclipse-path" with the eclipse path on your machine)
#!/bin/sh
/your-full-eclipse-path/eclipse
After that, give execute permission to the eclipse.command file you just created
chmod +x eclipse.command
I found the answer over on Ask Different
It's an ugly hack, but works perfectly.
posted on this page: Mountain Lion with Java 7 only
To trick OS X to accept Java 7 instead of proposing to install Java 6 a simple symlink is enough:
sudo mkdir /System/Library/Java/JavaVirtualMachines
sudo ln -s /Library/Java/JavaVirtualMachines/1.7.0.jdk /System/Library/Java/JavaVirtualMachines/1.6.0.jdk
Most Java Programs will run with this little hack without the need to install Java 6. OS X's Java Preferences (and maybe some others) will not as it seems to explicitly check the version of the JVM when it is started.
script above can fix my problem.
Hoping you are using 64-bit of Java SE 1.7.0 and so advising the following.
go to Eclipse->Preferences...->Java->Installed JREs
click Add...
Select Standard VM
paste /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home into JRE home
Change the JRE name to something useful like Java SE 7
Click Finish
Check the check-box next to your newly created JRE.
You would need a restart.
For what it's worth, the Eclipse team seems to have worked around it by replacing their dlopen()-based method with a CFBundleCreate()-based one: https://bugs.eclipse.org/bugs/show_bug.cgi?id=411361
In case anybody has the same problem in their code that launches Java and does not want to resort to Apple-only APIs, I found an easier work-around: before dlopen()ing $JRE_HOME/lib/server/libjvm.dylib, make sure to open dlopen() $JRE_HOME/lib/jli/libjli.dylib. Then it won't ask to install Java 6.
Can you imagine that? You have to install a JDK 1.6 to get eclipse ran properly, even if you already have jdk 1.7 installed, and set the JAVA_HOME properly.
To resolve your issue, you just need to download the jdk1.6 from http://support.apple.com/kb/DL1572?viewlocale=en_US, and install it, later you will be able to run eclipse, and you can set the JAVA_HOME to JDK1.7, and you will be able to find the JDK1.7 from eclipse "Preferences".
All these hacks does not work on mac Mavericks,
But a simple and efficient solution is found here
it worked with me like a charm.
Note: a drawback of this solution is when you check your java version using "java -version" command, it will read Java 1.6
open /Library/Java/JavaVirtualMachines/jdkXXXXX.jdk/Contents/Info.plist
settting(<string>BundledApp</string> is usefull!):
<key>JVMCapabilities</key>
<array>
<string>JNI</string>
<string>BundledApp</string>
<string>WebStart</string>
<string>Applets</string>
<string>CommandLine</string>
</array>
I had the exact same message when setting up a new mac and trying to run eclipse 4.2.2 with only Java SE 7 installed (as part of JDK 7u17).
In order to be able to successfully launch Eclipse I had to let OSX download and install Apple's Java SE 6 runtime first before installing the latest JDK.
After installing the JDK, the command java -version correctly shows:
java version "1.7.0_17"
Java(TM) SE Runtime Environment (build 1.7.0_17-b02)
Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)
Trying to solve the problem the other way around didn't work -- i.e. installing JDK 7u17 first before installing Java SE 6 as suggested in the message.
I had the exactly same problem some days ago and I solved it today. Just installed this http://support.apple.com/kb/dl1572
And after that, when I opened the eclipse the OSX installed some java update and opening eclipse by Eclipse.app started working.
Hope it works with you too.
If you'd like to install Java 6 JDK only (no Java 7 JDK/JRE, no Java 6 JRE only), install the Apple OSX Java DMG (at time of writing, this was http://adcdownload.apple.com/Developer_Tools/java_for_os_x_2013003_developer_package/java_for_os_x_2013003_dp__11m4406.dmg).
You still won't be able to start Eclipse. Make a directory JavaVirtualMachines under /System/Library/Java. And then make an Alias of the java version folder at /Library/Java/JavaVirtualMachines and rename the alias 1.6.0.jdk and copy that alias to /System/Library/Java/JavaVirtualMachines/
After finished, you will have an Alias at /System/Library/Java/JavaVirtualMachines/1.6.0.jdk that points to the Java install directory at */Library/Java/JavaVirtualMachines/1.6.0_XX-XXX-XXX.jdk*
Install latest JDK from Sun, it installs into /Library/Java/JavaVirtualMachines/, e.g. /Library/Java/JavaVirtualMachines/jdk1.7.0_40.jdk
sudo mkdir /System/Library/Java/JavaVirtualMachines
sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.7.0_40.jdk/ /System/Library/Java/JavaVirtualMachines/1.6.0.jdk
========= this trick used to work on Mountain Lion, but not on Maverick 10.9 somehow ============
Tried this again on Maverick, it does not work anymore. I also tried to change eclipse app plist and eclipse.ini (by adding -vm or ), does not work either.
Some people suggested that this is caused by Eclipse binary prepared using Apple 1.6 appbundler instead of Oracle java7 appbundler: Application is using Java 6 from Apple instead of Java 7 from Oracle on Mac OS X?
For now, please just type the eclipse from command line, which works fine with JAVA_HOME set to Java 7 (/usr/libexec/java_home command will tell you)
How to Make Eclipse Run on OS X 10.9 Mavericks
Attempting to launch various Eclipse versions after the Mavericks upgrade pops up a dialog with this message:
To open "Eclipse.app" you need a Java SE 6 runtime. Would you like to install one now?
It turns out that Java 7 is disabled by default in OS X 10.9.
This is easily verified as follows:
$ java --version
No Java runtime present, requesting install.
The solution is to install the latest supported Java version from Apple support: Java for OS X 2013-005 (http://support.apple.com/kb/DL1572)
As of 10/15/13 this would be Java SE 6 1.6.0_65.
Post Date: Oct 15, 2013
File Size: 63.98 MB
After the install, Eclipse will run as expected from the Dock, the Finder, or the Terminal without any tricks, hacks, or work-arounds.
I wanted to run Eclipse itself with Java 7. As I have a couple of plugins that do not work without it. For me neither solution worked for 10.9, but I found a workaround. The main idea is that you start eclipse with java -jar launcher.jar and provide a couple of magic properties and then it starts. This guy provided the command line script in comments that works for me:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=411361#c25
I found the same problem (Mac OS X 10.9.2, Java 1.7.0_53b13, Eclipse Kepler). The workaround was quite easy:
Find the executable in Finder (CMD+Click on Eclipse's icon in the Dock)
Remove the icon from the Dock
CTRL+Click on the executable in Finder
ALT+Open (to allow the execution of a non-signed application)
Eclipse opens normally and without any problem
Re-dragged the program onto the Dock
I had this problem and found that I did not have JDK installed on my Mac. Once I did that, Eclipse starts normally.
I had same problem.
First of all ; JDK(java development Kit) and JRE(Java Runtime Environment) are different things. It was confused by people
In order to install eclipse yo should install latest JDK . So
Visit
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Download suitable version for your mac
You can check your version now ; it won't be 1.6 anymore
Try to install eclipse again , see it works.
Good luck!..