Android Studio can't find Java SDK in Windows 8 - android

The new Android Studio has a strange problem when you run the installer in Windows 8. Even after installing the Java SDK and setting JAVA_HOME it still complains that it cannot find Java, which it is looking for under C:\windows\system32. The only solution I've found is to delete java*.exe from system32, but obviously this is not ideal (although you can replace them from the sdk dir afterwards). Is there something I'm missing? Also does anyone know why those 3 java exe files end up in System32 in the first place?

I had exactly the same problem.
Probably, you have java.exe in C:\Windows\System32 folder.
Rename this file and try installing again.
BTW, there are few related posts to check out.
Android SDK installation doesn't find JDK
Android studio doesn't start

Try opening Android Studio through the App menu instead of the file manager.

Related

Android studio automatically closes after opening

My Android studio is closing automatically. I have tried setting up JAVA_HOME in environment variables.But it doesn't work at all.Any problem with my SDK or java version?Currently I have both 32bit and 64bit of java JDK 8..But it doesn't work for both.Can someone resolve it soon..I have been trying it for 2 days..
Just uninstall android studio and download the .exe installer file for it here and try reinstalling it, if it doesn't still fix the issue, tell me again, else mark the answer as correct.

Cordova gradle wrapper missing in android sdk

I'm on windows7 x64, installed today's latest stable release of android sdk studio (through android studio bundle, since it's shipped together now apparently). I have properly configured the environment variables as you'll see above.
This is what I get when issuing the following command
$ cordova build android
ANDROID_HOME=G:\installs\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_121
Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.
Looked here: G:\installs\Android\sdk\tools\templates\gradle\wrapper
And indeed, the "templates" directory doesn't even exist in my sdk install.
I've already tried the suggestions (setting the right path, uninstall/reinstall) of this question here but nothing applies to my case, and I find that manually copying and pasting packages is not really a solution, since there's a package manager in place.
If anybody has an answer as of today's android install, would be very much appreciated.
If still not working then copy all file from gradle\wrapper from Android Studio installation folder
C:\Program Files\Android\Android
Studio\plugins\android\lib\templates\gradle\wrapper
and paste it in your Android SDK gradle\wrapper then run same command.
E:\android-sdk\tools\templates\gradle\wrapper
This is a known issue; see CB-12544. For now you'll need to downgrade.
I downloaded Android SDK r25 manually and placed templates folder inside Android/sdk/tools. This solved the issue for me.
You can get it from https://dl.google.com/android/repository/tools_r25.2.3-macosx.zip
For Windows:
https://developer.android.com/studio/index.html
Go to the section :"Get just the command line tools"
There is a link 'sdk-tools-darwin-3859397.zip' for Mac, Unfortunately that didn't have the templates folder with Gradle Wrapper. So for Mac users, i will suggest not to go for this zip.

Android Studio doesn't launch: Could not find or load main class com.intellij.idea.Main

Being new in Android devopmnet, I have been using Android Studio for development, but suddenly it doesn't work anymore.
The program doesn't launch anymore, and If I execute the studio.bat from Command Prompt, I get the following error:
Error: Could not find or load main class com.intellij.idea.Main
I have seen other posts about Android Studio not launching (e.g. this and this), but neither of them solve my problem. I have set PATH variables for both JAVA_HOME and JDK_HOME correctly to C:\Program Files\Java\jdk1.7.0_07
As I have mentioned, Android Studio used to work and I don't have any idea why it has stopped working. Any clue?
For android studio 1.3.1
go to environment variable and create new variable and give it a name JAVA_HOME and in path use this C:\Progra~1\Java\jdk1.7.0_71.
I hope that can help you.
if you have just used copy paste of exe file it will show this message so go in Program Files\Android\Android Studio\bin and click on exe file.
I had the same issue after updating the Android studio. I was not able to launch it from click on Android Studio icon and after running ./studio.sh it was giving me same error
I follow the below step and solved the problem.
I downloaded the studio and install it in the new directory.
After installation success, copy all the files & folders and paste and replace it into old location where studio was installed.
Having JAVA_HOME set to point latest JDK version (C:\Program Files\Java\jdk1.7.0_79) will make the Android studio work. Make sure the path is correct. Seems that JDK_HOME is not needed.
can refer Installing Android Studio (Not working)
If you have recently uninstalled and reinstalled Android Studio and had previously pinned the Android Studio icon to your Task Bar or Start Menu, it may be that this icon no longer looks for the new installation.
Delete it and re-pin it and all will be fine.
I faced the same issue while launching the studio.exe file. The actual problem was I have downloaded the 64-bit version of Android studio. But my computer supports only 32 bit.
So I downloaded 32-bit version and installed.
Now it is working fine.
Well after searching allover the web, failed to get solution till i decided to reinstall android studio. same folder changed nothing didn't delete anything just reinstalled and boom works as before
This happens when you update Studio and new version is installed and previous one is in process of deletion: at the main time if PC shut down or suddenly crashed due to power cut etc. Then this problem will appear:
could not find main class com/intellij/idea/main
Solution:
Go to this path "C:\Program Files\Android", there you will find two Android Studio Folders.
Find which one is latest: (Latest name wold be "Android Studio1") && (Old version would be Android Studio)
Delete old one(if you don't need it any more) and launch latest exe on this path:
C:\Program Files\Android\Android Studio1\bin
Open the Installer and download it again and you can select delete previous versions to clear confusion.
Open studio64 instead of studio
I found Answer: you just make wrong shortcut(just ctrl+C ctrl+v) for launchfile(exe). You must make shortcut following this method:
Right mouse click and select make shortcut menu.
Please follow the below steps,
Go to My Computer -> Properties -> Advance System Settings
System properties window will appear
Go to Advance tab -> Environment Variables -> New
Add or update JAVA_HOME path as expected.
Optionally you can also add or update JDK_HOME if you have JDK installed in your PC

Android Studio Can't Find JDK Mac

I'm just trying out Android Studio. I imported a project from Eclipse, but every time I try
to run it I get this error:
"Cannot run program
"Library/JavaVirtualMachines?jdk1.7.0_10.jdk/Contents/Home/bin/java"
(in directory
"/Users/myname/Library/Caches/AndroidStudioPreview/compile-server"):
error=2, No such file or directory.
I just installed the latest JDK using the JDK 7 Update 21 dmg. Is it installing the jdk in a place where Android Studio won't find it? The dmg didn't have any options for where to install the jdk other than "Install for all users of this computer," which I did.
When I was using Eclipse I had no problems with running my programs.
Furthermore, the Project Structure option was no longer available after I updated earlier today. Instead I just get the message, We will provide a UI to configure project settings later. Until then, please manually edit your build.gradle file(s.)"
I'm not sure what to do to get my programs running again. Do I need to locate the jdk files and move them? Could I tell Android Studio where the files are actually installed?
The solution was easier than I thought: just go to File/Other Settings/Default Project Structure and click SDKs. There the JDK home path can be changed.
Yes changing the JDK path will work. If that doesn't fix your problem, as it didn't for me at first, uninstall your JDK and redownload and install it. Once I reinstalled mine, it worked flawlessly.

Android Studio Java Error

I had installed OpenJDK7 in my machine for Java programming. Then I removed it and installed Oracle 1.7Jdk. But the problem is Android Studio isn't taking the new JDK. It gives the following error:
Cannot run program "/usr/lib/jvm/java-7-openjdk-i386/bin/java" (in directory "/home/pranay/.AndroidStudioPreview/system/compile-server"): error=2, No such file or directory
How can I run Android Studio?
Android-Studio may stores the location of Java in $HOME/.AndroidStudioPreview/config/options/jdk.table.xml
Delete this file and restart Android-Studio, it should now prompt you for your new Java location.
Cheers
Seems that Android Studio can't find your JDK, probably your system installed it on a different location (and not in "/usr/lib/jvm/java-7-openjdk-i386/bin/java").
I had another problem with Java and Android Studio, but I think the soulution could also work for you. IntelliJ needs a fixed installation of the JDK in one of these locations (found it here):
/usr/java
/opt/java
/usr/lib/jvm
My JDK was in another folder, so I moved it to /usr/java and now it works fine :)
The location is now:
~/.AndroidStudio/config/options
not
~/.AndroidStudioPreview/config/options
since AS has been officially released.

Categories

Resources