I am not able to install Android studio after downloading it - java

I have downloaded and installed JDK tool in my programx86 for windows 32.
I have set JAVA_HOME AND JDK_HOME variables. I have also set path.
I checked in the command prompt if JDK is installed and it is showing me version 1.8
Then, I downloaded Android studio.zip for windows 32.
Unzipped it, and saved it in the programx86 folder.
Now, I am suppose to run studio.bat and get the android window. But, in actual, when I click on studio.bat, I just get a flash and then nothing happens.
I tried everything. Uninstalling/installing java again and again. Setting the java path. Changing the location of Android studio.
But, it is not working for me. I am not getting the android installed. Please someone help.
I have a error file in my recent files. When I opened it, it has long text but the main msg is "EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x33773dd4, pid=7404, tid=0x00003898
#
JRE version: OpenJDK Runtime Environment (8.0_152-b02) (build 1.8.0_152-release-1024-b02)
Java VM: OpenJDK Server VM (25.152-b02 mixed mode windows-x86 )"
If this gives you a clue.

try to run .bat as Administrator. or for easy simply download Android Studio and install.

I'm a little late to the party, but I was having the same issue as you and here's what fixed it for me: setting a system variable named STUDIO_JDK to the path of your JDK installation ("C:\Program Files\Java\jdk1.8.0_181" in my case) then run "studio.bat".
Looking inside the .bat it looks like Android Studio checks STUDIO_JDK before JAVA_HOME or JDK_HOME.

i also face same issue ,but i resolved it.
Please check your C drive have proper space or not if no than make some good space.
if done that please check your android studio will run .
or
remove older version from your device and it will automatically start working .
Thanks !

Related

Netbeans 10 not installing

I'm having issues trying to install NetBean 10 (incubating) on a laptop. I've checked that Java is installed, as well as JDK (jdk1.8.0_191). I've checked that Java is installed correctly by going to the command line and typing "java -version" and it correctly responds
java version "1.8.0_191"
Java(TM)SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
I've checked that the environment varible "JAVA_HOME" is correct (echo %JAVA_HOME%), and that the Path variable is correct.
However when I try installing NetBeans (from the C:\netbeans10\bin\netbeans64.exe) (yes, also double checked the laptop is correctly running Win10 64bit, it is) a logo for netbeans briefly appears, goes away after 1 sec, and nothing else happens.
I've tried downloading a fresh NetBeans, reinstalling Java, rebooting the system, disabled anti-virus, disabled firewall, tried from safe boot, however it just does not install.
Anyone have any ideas on what step I'm missing so that I can get this installed?
Thanks in advance.
A possible caused of your problem is that NetBeans is trying to run using a version of Java that does not exist on your machine. To eliminate this as a possibility:
Locate the file netbeans.conf. It will be in the etc directory within the NetBeans installation directory.
Open the file in any text editor. It is just a properties file containing name/value pairs,
Locate the line containing the text netbeans_jdkhome.
If the line is commented out delete the leading # character.
Set the value to the actual path to your JDK. For example, on my machine it would be: netbeans_jdkhome="C:\Java\jdk1.8.0_191".
Save the file and (re)start NetBeans. NetBeans will now use the JDK specified by the netbeans_jdkhome property.
If NetBeans still doesn't start then update your question with the content of the NetBeans log. See NetBeans - where to find the IDE log? for details on locating that file.
One other point: although you can run NetBeans 10.0 using JDK 8, I can't think of any good reason to do that. Most users will probably download and install JDK 11, and use that instead.

Android.bat won't start. Sdk Manager won't run [duplicate]

This question's answers are a community effort. Edit existing answers to improve this post. It is not currently accepting new answers or interactions.
So I installed the android sdk for Windows:
http://developer.android.com/sdk/index.html (the installation link)
And ran into the path variable problem. So I fixed that by changing "PATH" in enviroment variables to include where my java.exe file is located from the JDK.
But now when I open the android sdk manager, a cmd-like screen just briefly flashes on for half a second then disappears. I have no idea what's going on and how to get this thing working.
Make sure your java\bin directory is in your path statement before the windows\system32 directory.
The SDK Manager uses java and it was finding the one in the system32 folder.
In a CMD window, you can run 'where java'.
Don't forget to restart your CMD after changing the path variable for checking.
Alright, I had the same problem, and none of these answers worked for me (I'm running Windows 8). I tried running tools/android.bat and noticed I got some errors there. I investigated further and it seems there is something wrong in the code that finds your Java path.
This is how you fix it:
Open up tools/android.bat in your favorite text editor
Search for this piece of code:
set java_exe=
call lib\find_java.bat
if not defined java_exe goto :EOF
Replace it with this:
set java_exe=D:\Program Files\Java\jdk1.7.0_07\bin\java.exe
where the path is the path to your Java exe.
Run android.bat
(in my case I had to specify the path to java_exe in step 3 with no quotes to make it work.)
There are many reasons as to why the SDK Manager won't open. Rather than trying each one of them blindly, I recommend running the android.bat in a command window so you can read the error message and apply the correct fix.
In the latest version of the Android SDK, running "SDK Manager.exe" and/or "AVD Manager.exe" will not open anymore. Even the "Launch Standalone SDK Manager" link in Android Studio, which can be previously found in Android SDK Settings, is now gone.
It is now recommended to perform manual SDK and AVD management inside Android Studio. But for those who do not have an Android Studio or for those who do not like to open Android Studio just to perform SDK management, you can still manage the SDK using the command line tools, "tools/bin/sdkmanager.bat" and "tools/bin/avdmanager.bat".
This information is available when running "tools/android.bat". I think this is true for those who currently have Android SDK tooks v25.3.1 and above.
Same problem here.
Fixed!
I installed the correct Java stuff, all for 64 bit, because my system is x64, and nothing happened. So I went to C:\Users\[my name] and deleted the directory .android that has been created the first time the SDK ran, apparently with some wrong configuration.
Then it worked. You can try that. Delete that folder or just move it to the desktop and run the SDK.
Google removed the GUI for SDK starting from version 26. If you're using version 26, try downgrading to version 25. You can still open the SDK from Android Studio.
Source: Is GUI for Android SDK manager gone?
There appear to be several ways to launch the SDK Manager:
SDK Manager.exe in the root of the Android SDK.
SDK Manager.exe in sdk\tools\lib of the Android SDK.
Window -> Android SDK Manager menu in Eclipse
android.bat in sdk\tools of the Android SDK.
In my case, it looks like android.bat fails on the line:
for /f %%a in ('%java_exe% -jar lib\archquery.jar') do set swt_path=lib\%%a
As far as what that line is doing... if I manually run: "[path_to_java]java" -jar lib\archquery.jar
It successfully returns: x86_64
But when the batch file runs that same command, I don't know why but it fails with the error message:
Unable to access jarfile lib\archquery.jar
So the variable swt_path gets set to an empty string. Everything breaks down from there.
The batch file sets the correct value for the variable java_exe. Others have commonly reported this as a problem, but those workarounds weren't relevant in my case.
People have recommended commenting out the problem line by adding REM to the beginning of it, and adding a line to manually set the swt_path variable, which is a valid workaround:
REM for /f %%a in ('%java_exe% -jar lib\archquery.jar') do set swt_path=lib\%%a
set swt_path=lib\x86
BUT, the critical issue in my case is that it's choosing to load a jar file from either the lib\x86 or the lib\x86_64 folder here. At some point, things were getting confused between the BAT file error, a 32-bit JDK, and a 64-bit Android SDK.
SO, the workaround in my case was to:
Uninstall ALL versions of Java
Install the JDK
You can either use the 32-bit Android SDK and install the 32-bit JDK
Or use the 64-bit Android SDK and install the 64-bit JDK
But the "bitness" of the JDK should match the Android SDK. It appears that either of the 32-bit or the 64-bit will work on a 64-bit computer, AS LONG AS the JDK bitness matches the Android SDK bitness.
Edit "android.bat"
If using the 32-bit Android SDK/JDK, use lib\x86:
REM for /f %%a in ('%java_exe% -jar lib\archquery.jar') do set swt_path=lib\%%a
set swt_path=lib\x86
If using the 64-bit Android SDK/JDK, use lib\x86_64:
REM for /f %%a in ('%java_exe% -jar lib\archquery.jar') do set swt_path=lib\%%a
set swt_path=lib\x86_64
After doing this, I can successfully run the SDK Manager by running android.bat, or from the Eclipse menu (but still not by running either of the SDK Manager.exe files directly).
The simplest way is to run the program as administartor.
Right-click the SDK Manager -> Run as Administrator
That should solve the problem :)
I had the same problem, tried setting path variables and everything. What SDK manager needs is not the JDK, but the actual Java SE end user crap. Go to http://www.java.com/en/download/ie_manual.jsp?locale=en and download that. As soon as I finished installing that, it worked like a charm
Try adding the Java path (pointing to the JDK) to the System Environment Variables.
Right-click 'Computer' > Properties > Advanced system settings > Environment Variables
Then under System Variables, add a new variable.
Variable Value
JAVA_PATH C:\Program Files\Java\jdk1.7.0
Then edit the Path variable, prefix it with %JAVA_PATH%\bin;.
Locating the android.bat file in the tools folder worked for me. Funny that it is such a chore to get it to run. In my experience, usually .exe files run as expected. I'm not sure why it doesn't in this case... strange and annoying!
I had something totally different than the other answers.
I ran tools/android.bat and got
java.lang.NullPointerException
at java.io.File.<init>(File.java:251)
at com.android.sdklib.internal.avd.AvdManager.parseAvdInfo(AvdManager.java:1623)
at com.android.sdklib.internal.avd.AvdManager.buildAvdList(AvdManager.java:1584)
at com.android.sdklib.internal.avd.AvdManager.<init>(AvdManager.java:357)
at com.android.sdklib.internal.avd.AvdManager.getInstance(AvdManager.java:380)
at com.android.sdklib.internal.repository.updater.UpdaterData.initSdk(UpdaterData.java:259)
at com.android.sdklib.internal.repository.updater.UpdaterData.<init>(UpdaterData.java:127)
at com.android.sdkuilib.internal.repository.SwtUpdaterData.<init>(SwtUpdaterData.java:61)
at com.android.sdkuilib.internal.repository.ui.SdkUpdaterWindowImpl2.<init>(SdkUpdaterWindowImpl2.java:104)
at com.android.sdkuilib.repository.SdkUpdaterWindow.<init>(SdkUpdaterWindow.java:88)
at com.android.sdkmanager.Main.showSdkManagerWindow(Main.java:408)
at com.android.sdkmanager.Main.doAction(Main.java:391)
at com.android.sdkmanager.Main.run(Main.java:151)
at com.android.sdkmanager.Main.main(Main.java:117)
Basically it looked like I had a corrupt AVD configuration, so I went and cleared out my virtual devices and everything started working again! (Files in C:\Users\YourUser\.android\avd for windows users)
I faced the same issue and finally managed to solve it. I then created a step-by-step guide containing the universal fix to help all developers get past this issue asap: http://www.dominantwire.com/2015/03/android-sdk-not-opening.html
All the steps in short:
1.If you have jdk v1.8. Remove it and re-install jdk v1.7.x.x
2.Set paths to jdk and jre bin folders in the environment variables
3.delete (make a backup first) the .android folder present in C: > Users > [user-name] > .android
4.Set the JAVA_HOME variable keeping JAVA_HOME as the variable name and the path to bin folder of jdk as the variable value.
5.Go to [sdk-directory] > tools. Find and right-click on android.bat file and select 'edit' to open it in notepad and make the following modifications.
ORIGINAL
set java_exe=
call lib\find_java.bat
if not defined java_exe goto :EOF
MODIFIED
set java_exe=C:\Program Files\Java\jdk1.7.0_75\bin\java.exe
rem call lib\find_java.bat
rem if not defined java_exe goto :EOF
NOTE : Copy and paste your own java.exe path directory as explained previously.
ORIGINAL
for /f "delims=" %%a in ('"%java_exe%" -jar lib\archquery.jar') do set swt_path=lib\%%a
MODIFIED
rem for /f "delims=" %%a in ('"%java_exe%" -jar lib\archquery.jar') do set swt_path=lib\%%a
set swt_path=lib\x86_64
NOTE : If your android sdk is 64bit then mention set swt_path=lib\x86_64 otherwise if it is 32bit then keep it as set swt_path=lib\x86
Done! Fire up android sdk from android.bat file or from eclipse. It should open up just fine!
I tried almost all the solutions provided here. But nothing worked out. And finally, I downloaded tools(tools_r25.2.3-windows.zip) from the below link and replaced the tools sub-folder in the sdk folder. It started working.
https://developer.android.com/studio/index.html#downloads
Sharing this as an information though it's an old thread.
I recently faced this problem after I installed android emulator using the sdk manager of android studio - which also upgraded my android sdk tools to 26.0.1 (as it was a prerequisite - according to the sdk manager of android studio).
In my case, I simply replaced the tools folder of android sdk with tools folder from an older android sdk. This downgraded the android sdk tools, but now I can open the sdk manager using SDK Manager.exe.
Also make sure there is not as JRE before your JDK in PATH on Windows. Oracle always stuffs its own JRE into the path before anything else (I had installed Oracle Lite after I installed the android sdk).
Same problem here, I tried all solutions but nothing worked. Then I went into C:\Users\User_name and deleted the ".android" folder and then, the SDK Manager could open normally, and automatically created other ".android" folder.
I have solved this issue. If you are not able to open "SDK Manager.exe" from explorer or if you are facing any problem with SDK Manager.
Firstly check Java path is given in Environment Variable. (run Java command on CMD, or run Where Java on CMD as Administrator). If Java command is recognized, there might not be problem with Java
This might be due to broken SDK Tools. To fix it firstly rename tools folder (Android\Sdk\tools) to tools.old. Now download https://dl.google.com/android
/repository/tools_r25.2.3-windows.zip?hl=id.
After that Extract the downloaded zip files to Android\Sdk\ hence new tools folder would be extracted with all the contents for SDK. Now open SDK Manager.exe. If it opens your issue is solved. Please note that SDK Manager.exe is a launcher file that launches Android\Sdk\tools\bin\sdkmanager.bat. if you are satisfied with the answer please Upvote so that maximum users would solve the issue. For further help visit this page https://answers.unity.com/questions/1320150/unable-to-list-target-platform.html
Been trying to get the SDK manager to run for a while now following various threads with similar problems I could find.
Another solution to consider is to move android SDK to a dir without spaces in its name.
For instance in my case it resided in:
e:\Program Files (x86)\Android\android-sdk\
and would fail.
When moved to:
c:\android_sdk_sucks\
It worked.
I tried all the most popular solutions before and no one worked for me, until I realised that the Android SDK folder must not have any spaces, so I changed it from "C:\Android SDK" to "C:\Android_SDK". As simple as that.
Nothing helps me from all this answers, but I found the right steps (Windows 7 64 bit):
1) Open android.bat from your sdk folder for editing;
2) Add exactly this two strings:
set java_exe=c:\Program Files\Java\jdk1.8.0_25\bin\java.exe
rem call lib\find_java.bat
instead of this:
set java_exe=
call lib\find_java.bat
if not defined java_exe goto :EOF
Where c:\Program Files\Java\jdk1.8.0_25 is your jdk folder.
3) Enjoy. SDK Manager will launch from Android studio IDE.
I installed Android Studio for Mac. I was not able to access the SDK manager through the IDE. It turns out I just had to have my JAVA_HOME environment variable set. Once I got this set I was able to launch the SDK manager.
I'd encountered the same problem. When running the android.bat I found the solution (if Java is installed in the 'normal' Windows directory, ie 'program files') you need to put quotes surrounding "c:/program files/" etc etc. Otherwise it cannot find java on "C:/program". (me dislikes spaces)
The issue with mine was that I could run SDK manager through double clicking android.bat but not when I double click on the actual SDK manager application. I solved this issue by setting a new environmental variable:
ANDROID_HOME = C:\Development\adt-bundle-windows-x86_64-20130911\sdk\
restarted my pc and now I can double click on the application and run SDK Manager. Hope that helps :)
I saw answers that provide workaround solutions by hard coding java.exe location and x86 / x86_64 architecture string in sdk\tools\android.bat. Those are quick solutions but did not solve the fundamental issue that I am actually curious of.
The actual problem that I encountered is, the batch script is not able to find another script/jar file and thus is failed to proceed. I could say the script was poorly written.
After I made the following changes in sdk\tools\android.bat, everything works like a charm.
Specifically, I added %~dp0\:
set java_exe=
call %~dp0\lib\find_java.bat
if not defined java_exe goto :EOF
...
for /f "delims=" %%a in ('"%java_exe%" -jar %~dp0\lib\archquery.jar') do set swt_path=lib\%%a
Now, try to launch the script and SDK Manager should come out.
p.s. My installation of OS, Java 8 and Android SDK are fresh and I did not do any of the extra configuration.
p.s. You may still need to configure PATH environment variable so that the script could find the suitable java.exe.
I test every way, But only working way was re Installing sdk-manager in same path as old one
http://quantumsupport.blogspot.com/2011/03/android-sdk-managerexe-wont-start.html
Create a new user account, either re-install or just start android.bat and it should work did for me
I encountered a similar problem where SDK manager would flash a command window and die.
This is what worked for me: My processor and OS both are 64-bit. I had installed 64-bit JDK version. The problem wouldn't go away with reinstalling JDK or modifying path. My theory was that SDK Manager may be needed 32-bit version of JDK. Don't know why that should matter but I ended up installing 32-bit version of JDK and magic. And SDK Manager successfully launched.
OS: Windows 7- 64 bit, Android SDK: 64 bit
Introduce a new 'System variable' named: JAVA_HOME with value: C:\Program Files\Java\jdk1.7.0_51
Right-click on SDK Manager.exe -> Run as administrator
A check list:
Make sure the java path in system variable 'Path' is something like: C:\Program Files\Java\jdk1.7.0_51\bin
There is no space in your folder name, replace something like C:\Android SDK with C:\Android_SDK
You can find your java with 'where java' command in command line

Android Studio doesn't find JDK [duplicate]

I downloaded Android Studio and attempted to launch the program.
This is running on Windows 7 64-bit with Java 1.7. During the installation, my Java 1.7 is detected, and the rest of the installation goes through just fine. However, when attempting to launch the application from the desktop icon, nothing happens. Looking at the task manager, a new process from the CMD is loaded. This is because it's attempting to run the batch file studio.bat.
When I execute via CMD, I get the following error:
ERROR: cannot start Android Studio. No JDK found. Please validate
either ANDROID_STUDIO_JDK or JDK_HOME or JAVA_HOME points to valid
JDK installation. ECHO is off. Press any key to continue . . .
I've attempted to open the idea properties file to see if there was something I could configure for this ANDROID_STUDIO_JDK or something like that. However, I found nothing. I hope some of you can let me know if you were able to install this or if you are having problems as well.
Adding a system variable JDK_HOME with value c:\Program Files\Java\jdk1.7.0_21\ worked for me. The latest Java release can be downloaded here.
Additionally, make sure the variable JAVA_HOME is also set with the above location.
OK, I figured out how fix this nasty bug.
Before you start
Go to your Android Studio installation folder and locate the bin folder. Inside the bin folder, you will find studio.bat. Execute the file, and it'll show the error. If it is about the Java path then follow the tip 1.
Tip 1
When you set the path JAVA_HOME, etc., make sure not to include bin at the end of the path. This solved the issue for me.
JAVA_HOME => C:\Program Files\Java\jdk1.7.0_21
path => C:\Program Files\Java\jdk1.7.0_21\bin
It works fine with JDK 1.7 (I tried with 32 bit).
If you do so, you can see the initial screen as below.
Tip 2
Are you getting the below error message?
Your Android SDK is out of date or is missing templates. Please ensure
you are using SDK version 22 or later.
This error probably occurs, because you have reference to your older SDK (that you downloaded with Eclipse) in your path variable. Go to Environment variables and remove any reference to the old SDK folder and point it to new SDK folder that is found inside the Android Studio installation folder.
Save and restart Studio, things should work as expected now.
Tip 3
If you hate messing around with the path variable as given above by removing old references, simply follow the following steps to refer to new SDK path that comes with Studio.
*Project Defaults* -> *Project Structure* -> Click "New" -> Select "Android SDK" -> Select the SDK folder inside the studio installation.
With the last update of Android Studio, I have two versions of the IDE's launcher
One is called studio.exe and the other studio64.exe they are both on:
C:\Users\myUserName\AppData\Local\Android\android-studio\bin
You have to launch the one that matches your Java version 64 or 32 bit
I had the same issue. I got resolved setting up correctly the environment variables in windows, for instance:
JAVA_HOME -> C:\Program Files\Java\jdk1.6.0_45
path -> C:\Program Files\Java\jdk1.6.0_45\bin
I've tried so many of the answers here but none of them works, so I decided to mix some of the answers here and I am successful!
Step 1: Go to the system properties by right-clicking on My Computer or by pressing windows button on typing This PC and right clicking on it and selecting Properties.
Step 2: Click the advanced system settings or Environment Variables
Step 3: Take note that there are 2 different variable. What you need to create is system variables not user variables, when you clicked new type the following
Variable name: JAVA_HOME
Variable value: C:\Program Files\Java\jdk1.8.0_25\ (Note: Please check if the path is right, sometimes it is C:\Program Files (x86)\Java\jdk1.8.0_25)
Step 4: Run the android studio, no need to restart.
Note:
*C:\Program Files\Java\jdk1.8.0_25\ depends entirely on the installation path of your JDK not JRE so don't be confused if you see something like the picture below. Just enter the location of your jdk, in my case it is C:\Program Files\Java\jdk1.8.0_25\.
*Do not include the bin folder when you enter the Variable value.
Edit: For Windows 8 and 10 Users: Try to run C:\Program Files\Android\Android Studio\bin\studio.exe instead of C:\Program Files\Android\Android Studio\binstudio64.exe
I had the same issue. I am having 64-bit windows 8. I downloaded the android studio which worked on a 32-bit machine but not on my 64-bit.
The solution for me was pretty simple. I navigated to
C:\Program Files (x86)\Android\android-studio\bin
there I saw 2 exe files studio.exe and studio64.exe. Normally my start menu was pointing to studio64.exe which always kept on giving me "The environmental variable JDK_HOME does not point to valid JVM". So then I clicked studio.exe and it worked :)
I hope this may help someone facing the same problem as me
The path for the latest JDK. It worked very well.
If you are getting message "Your Android SDK is out of date…" — click "Configure" —> "Project Defaults" —> "Project Structure", pick "SDKs" —> "Android SDK" and in a "Build Target" choose "Android 4.2.2". Click "OK". Now it should work fine.
I got the problem that the installation stopped by the "$(^name) has stopped working" error. I have installed the Java SE Development kit already, and also set both SDK_HOME and JAVA_HOME that point to "C:\Program Files\Java\jdk1.7.0_21"
My laptop installed with Windows 7 64 bits
So I tried to install the 32-bit version of the Java SE Development kit, and set my JAVA_HOME to "C:\Program Files (x86)\Java\jdk1.7.0_21", restart and the installation worked OK.
This problem has been fixed in Android Studio v0.1.1, so just update Android Studio and it should work.
Sometimes you can resolve this type of issue by setting environment variables so the process looks for the JDK in the right spot.
Another approach is to figure out where the process is looking, then put your JDK there.
I've had lots of success using Process Monitor from Sysinternals:
Start -> Run -> procmon
Go to the Filter menu, then select Filter...
Set Event Class is File System then Include
Add, then OK
This will filter down to all the file system operations taking place on your machine.
You could try filtering based on the result of the File System operation:
Right click on the Result column, then Exclude 'SUCCESS'
You can also quite easily filter based on the process name, either from the Filter... menu option or by right clicking on the Process Name column and selecting Include 'process.exe'.
Once you find the file system operation that's failing, the Path column will tell you where to put your JDK.
I've found this to be very empowering. Especially compared to the frustrating process of changing environment variables by trial and error.
My issue was caused because I have an & character in my Windows user name, so when installed in the default path I was getting the following error after running bin/studio.bat
|
v notice broken path
The system cannot find the file C:\Users\Daniel \studio64.exe.vmoptions.
Exception in thread "main" java.lang.NoClassDefFoundError: com/intellij/idea/Main
Caused by: java.lang.ClassNotFoundException: com.intellij.idea.Main
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: com.intellij.idea.Main. Program will exit.
So I uninstalled and reinstalled it to program files and it launches fine now.
I couldn't get this to work no matter which environment variables I set. So I simply put a copy of the JDK into my Android Studio installation folder.
Copy the contents of the JDK installation (for example, C:\Program Files (x86)\Java\jdk1.7.0_21)
Paste them into the installation directory of the Android Studio (for example, C:\Program Files (x86)\Android\android-studio)
I somewhat assumed that the issue was caused by having the x64 version of the JDK installed. But what was especially confusing was the fact that I could start Android Studio just fine when I started the studio.bat as an Administrator (even though the environment variables were set for my personal user account).
studio.bat will look for several valid options when determining which JDK to use.
:: Locate a JDK installation directory which will be used to run the IDE.
:: Try (in order): ANDROID_STUDIO_JDK, ..\jre, JDK_HOME, JAVA_HOME.
As explained above, I picked the ..\jre option.
Today I found another situation when this problem occures - when you have several JDK, defined in JAVA_PATH. I have:
JAVA_HOME = C:\JAVA\JDK\jdk1.6.0_38;C:\JAVA\JDK\jdk1.7.0_10
So I received this problem with Android Studio setup
But when I've removed one of JDK - problem has been solved:
JAVA_HOME = C:\JAVA\JDK\jdk1.7.0_10
Installation wisard found my jdk and i had a nice night to study studio.
But unfortunatelly even installed studio doesn't work with several jdk.
Does anybody know how to fix it?
I hope I've helped someone
Add JAVA_HOME and JDK_HOME system environment variables.
Right-click
android studio (the 64 version if that's your OS and JDK) and go to
compatibility tab and set "Run as administrator" to true.
Run android studio and high-five me virtually when it works.
If that fails, try "where java" in cmd.exe. If it lists c:\system32\java.exe first, then rename the file and try again.
Windows 64 bit, JDK 64 bit (Solution that worked for me)
Tried all the above solutions, and None of them worked, I have been trying to solve it for the past few days and now I did it successfully. For me the problem was when I first installed Android Studio my JDK version was 1.7, then after installing I updated the JDK to 1.8, then I removed the old JDK folder and everything was messed up, even uninstalling and reinstalling android studio randomly didn't solve the issue.
Below is the solution that worked for me
Uninstall Android Studio.
clean temp files and android studio C:\Users\Username.AndroidStudio1.5
Uninstall JDK.
Now without JDK try to install Android Studio and now it will show the message that it can't find any JDK. Stop installation
Install JDK 1.7 or 1.8 (Set JAVA_HOME, JDK_HOME, path Environment variables as explained by everybody above)
Install Android Studio.
Done. Enjoy and happy coding.
MAKE SURE YOU RESTART ANDROID STUDIO
Even though I should know better and swear I did, make sure you restart studio after making these changes as it clearly does not check them on every build (which to me makes sense that system/user variables should only be read once on startup)
Anyway, yea... Make sure you restart after you make these changes.
Path = to the bin folder in the jdk folder (path already exists)
JAVA_HOME = to the jdk folder
Install the latest JDK in your system from JDK 7 and JRE 7 Installation Guide.
JAVA_HOME -> C:\Program Files\Java\jdk1.7.0_4
path -> C:\Program Files\Java\jdk1.7.0_4\bin
If setting the JAVA_HOME variable doesn't work for you, set:
STUDIO_JDK=C:\Progra~1\Java\jdk1.8.0_172
Where the path points to your JDK installation
This is the only thing which works for me in Windows 32bit with Android 10 and up.
In my experience, I was unable (even after adding JDK_HOME) to launch Studio via either the shortcut or studio.exe itself. I had to first run bin/studio.bat (mentioned in the original question).
After the first successful launch, I'm able to start it with the shortcut.
If you have a 64 bit windows OS, pointing the JAVA_HOME system variable to
C:\Program Files (x86)\Java\jdk1.7.0_21
Will work when
C:\Program Files\Java\jdk1.7.0_21
fails to work.
You need 1.7 JDK installed on your system. Add a system variable with:
name: ANDROID_STUDIO_JDK
path: your JDK path (for example, C:\Program Files\Java\jdk1.7.0_21)
See more at FIX: Android Studio - Installation Issues on Windows 7 | ERROR: cannot start Android Studio. No JDK found.
TRY TO INSTALL 32BIT JDK
if you have jdk installed and had set up the System Varibles such as JAVA_HOME or JDK_HOME
and tried click back and then next ,you might have installed the 64bit JDK,just download the 32bit jdk and install it.
I downloaded the latest jdk version
JAVA_HOME to C:\Program Files\Java\jdk1.8.0_11\bin
Set the PATH to C:\Program Files\Java\jdk1.8.0_11\bin
I restarted the STUDIO and it worked.
On Windows 10, restarting the installer and running as admin worked for me.
To complete this stack of possible solutions: For me the problem was, that I did not execute the Android-Studio-Setup as administrator. Running it as administrator then made me able to install Android-Studio.
For me, the problem was that I had changed the GC vm arg to -XX:+UseParallelGC in the C:\Users\<username>\.AndroidStudio2.1\studio64.exe.vmoptions file. That's what I use in Eclipse and I was trying various things to get AndroidStudio half way as efficent as Eclipse. I restored the GC to -XX:+UseConcMarkSweepGC.
The answer to the original question is that, might be you are opening android studio from 32 bit shortcut icon of android studio, try to open from icon "studio64" located under .../bin/ where android studio setup is install.
In case you had it running but Now it doesn't Launch.
I deleted the C:\Users\<NAME>\.AndroidStudio<version>\ folder and it worked.

JDK error when trying to start Android Studio

I have just switched from Windows7 to Windows8.1 and I'm having trouble making Android Studio work now.
I have installed Android Studio and the JDK. First I tried it out with the latest versions Android Studio v.0.8.14 and JDK 1.8, but I could not get it to work. I then tried to use the versions I used on my previous Windows7, and installed Android Studio 0.8.2 and JDK 1.7.0_67, but I still can't get it to work.
The error I'm getting is:
Failed to load JVM DLL C:\Program Files\Java\jdk1.7.0_67\jre. If you
already have a 64-bit JDK installed, define JAVA_HOME variable in
Computer > System Properties > System Settings > Environment
Variables
I have set JAVA_HOME to my JDK path. I've tried to add \bin to that path, which didn't help. I've tried to add the JDK_HOME variable and set path to it, which didn't help either. I have also added "C:\Program Files\Java\jdk1.7.0_67\" to my PATH variable, which also didn't help. I tried editing studio.bat adding a string to point to my JDK folder, which also didn't work.
When I check my Java from console (cmd) I get the msg that it works find:
C:\Users\Igor>java -version java version "1.7.0_67" Java(TM) SE
Runtime Environment (build 1.7.0_67-b01) Java HotSpot(TM) 64-Bit
Server VM (build 24.65-b04, mixed mode)
Is Windows 8.1 the problem? Do I have to do something different on it?
Follow these steps:
Control Panel>>System>>Advanced(tab)>>Environment Variables>>System Variables
New
Variable name: _JAVA_OPTIONS
Variable value: -Xmx512M
I had exactly the similar problem:
failed to create JVM: error code -6
JVM PATH: .............
If you already have a 64-bit JDK installed, define a JAVA_HOME variable in Computer > System Properties > System Settings> Environment Variables.
Note: Do *not* choose a Java "JRE". You need to point to a full JDK, otherwise the IDE may fail to start. See http://tools.android.com/knownissues for more details.
Solution for me
I solved it with the help of Rahul Wadhai:
1) Go to C:\users\<your_user>.AndroidStudio2.2\ and open studio.vmoptions
2) change -Xmx and XX:MaxPermSize to lower values(then you have currently) and try to run AS again. ( If it does, then you can increase the values back. )
3) If it doesnt help, then try to rename .AndroidStudioX.X and then open AS again.
4) If it doesnt help, then you can search the problem within this android folder (using TextCrawler) , maybe somewhere in config files, there needed to change something. And then you can import settings from old folder.
You need to mention the JDK folder path in the Environment variable:
JAVA_HOME=C:\Program Files\Java\jdk1.7.0_51
Don't use build number coming in cmd.
To get this working, I put my JDK path in the Path variable as the first item. For some reason, when it's the last item it does not work.
You have to create a new variable in the System variable named JAVA_HOME = "C:\Program Files\Java\jdk1.7.0_67", in your PATH variable.
I tweaked the studio.vmoptions file when I followed a method in making it run faster and it stopped working showing the same JDK error.. I did most of the fix mentioned above and none worked for me. What worked for me though was deleting the studio.vmoptions file and everything was great again.
Go to your c:\ users\yourcomputername\ for example .AndroidStudio1.5
You will see config and system folder in it then delete the .AndroidStudio1.5 using it as example .
Go and relaunch the studio64
This is the solution that worked for me after many frustrated attempts:
go to the folder C:\program files\Android\Android Studio\bin
rename the file 'studio.64' to 'studio.bat' and run this file.

Android Studio failed to load JVM on Mac OSX (Mavericks)

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.

Categories