Installing Android Studio (Not working) - java

I'm trying to instal Android Studio for Windows but I get an error: "Could not find main class com/intellij/idea/Main"
I installed the 64 bit jdk and created an environment variable called JAVA_HOME and linked this to my jdk as so: "C:\Program Files\Java\jdk1.7.0_71"

Are you sure you have installed 64bit ?
Generally for 64bit installation default path will be "c:\Program Files (x86)\Java\jdk1.7.0_71"
Another thing to check if your java installation ( 64bit is compatible ) is fine.
a. open command prompt.
b. cd {your java installation}\jdk1.7.0_71\bin
c. type "java" and "java -version" ( See if both command works )

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.

Add a system variable JDK_HOME with value c:\Program Files\Java\jdk1.7.0_71\

Just install java jdk and jre and runtime environment and java 8 update 45 in 64 bit if your computer is 64 bit and 32 bit if your computer is 32bit and then in your environment variable just remove the /bin from it.

Related

Android SDK command line Java not found

I want to install the android SDK command line tool version 25.2.3 on my Windows 10 x64 pc. I've installed Java SDK and created two system variables JAVA_HOME and JRE_HOME which point to the corresponding path, but it still doesn't work. I can't do the next-previous-solution since I want to install the command line version. I've attached an image showing the error and the system variables. Thanks in advance!
You have set JAVA_HOME and JRE_HOME but, missed to set Java's bin directory to be able to execute java, javac etc commands. Do to so, set PATH(replace first java entry) to include Java's bin directory as JAVA_HOME\bin.

Android Studio can't open because of invalid because of JVM installation

The problem is that when I start Android Studio it shows me this table which says that I haven't installed a valid version of JVM
http://i.stack.imgur.com/ljyhQ.png
I have checked the path of JAVA_HOME in my Environment Variables and it is correct
http://i.stack.imgur.com/jPYQe.png
What should I do to correct it?
You are referring to jre not jdk. Change your JAVA_HOME point to valid JDK
Install latest version of jre and also check your os 64 bit or 32. and set jdk path instead of jre
I had the same problem. I fixed it by deleting the jre.Then installer asks to install jre (at installing again). If its not running make a JAVA_HOME variable to this path.

tools.jar seems to be not in Android Studio classpath on Windows 8

I installed Android Studio but it was giving me error that I need to install JDK but JDK was already installed. Then I realized it is asking to install 64bit version of JDK.
Anyway I just downloaded latest JDK 64bit version and set the following in Environment Variable but still Android Studio is giving error:
Error
'tools.jar' seems to be not in Android Studio classpath.
Please ensure JAVA_HOME points to JDK rather than JRE.
Following paths are set in my Windows 8.
Path in User Variables
E:\Program Files\Java\jdk1.8.0_25\bin
JAVA_HOME in System Variables
E:\Program Files\Java\jdk1.8.0_25
Path in System Variables
E:\Program Files\Java\jdk1.8.0_25\bin
32bit JDK is installed on C drive while 64bit JDK is installed on E drive (as shown above). 32 bit JDK is not being used in any User or System Variables.
I have also restarted the PC.
How do I fix this issue?
I had this same problem and was able to fix it after wasting about 3 hours:
Just copy tools.jar from %JAVA_HOME%\lib to (Android Studio Root)\lib
check your JAVA_HOME value!
it should be like this
E:\Program Files\Java\jdk1.8.0_25\jre
First locate in your PC the route of your JDK (for instance: C:\Program Files\Java\jdk1.7.0_45)
then change the JAVA_HOME variable as follows:
Right-click the My Computer icon on your desktop and select Properties
Click the Advanced tab
Click the Environment Variables button
Under System Variables, click New
Enter the variable name as JAVA_HOME
Enter the variable value as the installation path for the Java Development Kit
I installed jdk 1.8.0_51 64bit on Windows7.
After that, no JAVA_HOME was defined, so I had to define it myself as described above, but it did not work unless I added a trailing backslash:
D:\Programs\Java\jdk1.8.0_51\.
Without the backslash at the end it did not work.
Known issue - my solution was to install JDK 7u80 - worked after that.
https://code.google.com/p/android/issues/detail?id=187048
Just Copy the tools.jar from your jdk to Android lib directory.
In my case I've installed newest Java version without uninstalling older version first. After I've uninstalled the older Java version this error was gone.
Also make sure your JAVA_HOME system variable is set properly, e.g.:
Variable Name: JAVA_HOME
Variable Value: C:\Program Files\Java\jdk1.8.0_31\
And finally, that you've installed proper version for your OS, x86 or x64.
I had exactly the same problem.
In my case I finally installed JRE to "C:\Program Files..." and the JDK to my default destination , which is "E:\Program Files..."
It seems that the JDK and JRE cannot point to the same place for Android Studio .
I had the same issue on windows 7 when I installed Android Studio. I had Jdk 8 on my system. So for me, copying the tools.jar from jdk\lib to androidstudio\lib worked. I found the tools.jar was missing from androidstudio's lib directory. I had set JAVA_HOME in user variable and JDK in system variable.
I had the same error -- tools.jar seems to be not in Studio classpath. Please ensure JAVA_HOME points to JDK rather than JRE.
I have a few Java JDKs downloaded. JAVA_HOME was pointing to C:\java\jdk1.7.0_45. When I switched to C:\java\jdk1.7.0_75, it worked. It makes no sense - both have lib/tools.jar. I did a jar tvf on each of the tools.jar files and they were fine. I ran java -version on each java & it ran ok. Dunno - makes no sense.
Platform: Windows 7 Professional - 64-bit v1.10.00.AG B11 Service Pack 1
Installing it to the default installation path instead of a custom one did solve the issue for me.
Source: https://code.google.com/p/android/issues/detail?id=187048#c9
First locate in your PC the route of your JDK (for instance: First locate in your PC the route of your JDK (for instance: C:\Program Files\Java\jdk1.8.0_11)
then change the JAVA_HOME variable as follows:
Right-click the My Computer icon on your desktop and select Properties
Click the Advanced tab
Click the Environment Variables button
Under System Variables, click New or edit it if there already a path for it ( you should make sure that the path is jdk)
Enter the variable name as JAVA_HOME
Enter the variable value as the installation path for the Java Development Kit)
1) Just install JDK from here
2) Change JAVA_HOME variable (e.g. C:\Program Files\Java\jdk1.8.0_112)
I add a similar problem on Linux.
In my case my JAVA_HOME env was pointing to the JRE HOME instead of the JDK HOME.
On my linux system I had done:
sabayon ~ # eselect java-vm list
Available Java Virtual Machines:
[1] icedtea-bin-8
[2] oracle-jdk-bin-1.8
[3] oracle-jre-bin-1.8 system-vm
sabayon ~ # eselect java-vm set system 2
And then Android Studio started like a charm. Download and install the SDK.
After I set JAVA_HOME variable and restart my windows pc I resolved my issue.
JAVA_HOME value should like below.
C:\Program Files\Java\jdk1.8.0_25\bin
I paste a screenshot for someone's help.
You can go here From My Computer / This PC > Property > Advance Variable.
I recently came across this issue while using a Managed Software solution. The company I was working with had Android Studio has part of their managed applications, however, it was a much older version that the latest release. When you use an older version of Android Studio coupled with a newer JDK (I tried 11 and 15) you then receive the error indicating tools.jar cannot be found in CLASSPATH. I resolved this by downloading the latest version from Android Studio's website and it worked like a charm!
I tried everything I could but it didn't help. So I reinstalled Windows and installed Android Studio and now everything works.
And the irony is, there is no JAVA_HOME or JDK_HOME variable defined but it still works.

With android studio no jvm found, JAVA_HOME has been set

I have a JAVA_HOME variable set to:
C:\Program Files (x86)\Java\jdk1.7.0_45\
And the path to the jdk is:
C:\Program Files (x86)\Java\jdk1.7.0_45
However when I try to start android studio I get the error:
No JVM installation found. Please install a 64 bit JDK. If you already
have a JDK installed define a JAVA_HOME variable in Computer > System
Properties > System Settings > Environment Variables.
It says that it should be a 64-bit JDK. I have a feeling that you installed (at a previous time) a 32-bit version of Java. The path for all 32-bit applications in Windows 7 and Vista is:
C:\Program Files (x86)\
You were setting the JAVA_HOME variable to the 32-bit version of Java. Set your JAVA_HOME variable to the following:
C:\Program Files\Java\jdk1.7.0_45
If that does not work, check that the JDK version is 1.7.0_45. If not, change the JAVA_HOME variable to (with JAVAVERSION as the Java version number:
C:\Program Files\Java\jdkJAVAVERSION
Here is the tutorial :-
http://javatechig.com/android/installing-android-studio
and http://codearetoy.wordpress.com/2010/12/23/jdk-not-found-on-installing-android-sdk/
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.
Please note that the above location is my java location. Please post your location in the path
Though, the question is asked long back, I see this same issue recently after installing Android Studio 2.1.0v, and JDK 7.80 on my PC Windows 10, 32 bit OS. I got this error.
No JVM installation found. Please install a 32 bit JDK. If you already
have a JDK installed define a JAVA_HOME variable in Computer > System
Properties > System Settings > Environment Variables.
I tried different ways to fix this nothing worked. But As per System Requirements in this Android developer website link.
Its solved after installing JDK 8(jdk-8u101-windows-i586.exe) JDK download site link.
Hope it helps somebody.
For me the case was completely different. I had created a studio64.exe.vmoptions file in C:\Users\YourUserName\.AndroidStudio3.4\config. In that folder, I had a typo of extra spaces. Due to that I was getting the same error.
I replaced the studio64.exe.vmoptions with the following code.
# custom Android Studio VM options, see https://developer.android.com/studio/intro/studio-config.html
-server
-Xms1G
-Xmx8G
# I have 8GB RAM so it is 8G. Replace it with your RAM size.
-XX:MaxPermSize=1G
-XX:ReservedCodeCacheSize=512m
-XX:+UseCompressedOops
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-da
-Djna.nosys=true
-Djna.boot.library.path=
-Djna.debug_load=true
-Djna.debug_load.jna=true
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-XX:+HeapDumpOnOutOfMemoryError
-Didea.paths.selector=AndroidStudio2.1
-Didea.platform.prefix=AndroidStudio
When you set to install it "for all users" (not for the current user only), you won't need to route Android Studio for the JAVA_HOME.
Of course, have JDK installed.
Just delete the folder highlighted below. Depending on your Android Studio version, mine is 3.5 and reopen Android studio.

sdk bundle install java error

I have tried to install sdk bundle on windows 8 64 bit and windows 7 64 bit machines.
After unpacking to c:\development dir I try to run te eclispe.exe from \adt-bundle-windows\eclipse and I get same error for both:
![error message][1]
"a java runtime enviroment JRE or JDK must be available to run eclipse. No java virtual machine found in c:\development\adt-bundle-windows\eclipse\jre..."
There is no jre directory in the installed c:\development... therefore the error.op
I tried installing java manually to the eclipse directory but it did not create a jre directory so error came up the same.
My understanding from the install instructions is that everything needed is provided in the "bundle"!
What am I missing? Why is the java stuff not there?
If you have the JRE installad on your machine, then go to Properties of my computer > Advanced tab > Select Environment Variables
Then in the section of System variables, look for the variable "Path" and edit that, and add you JRE path there with a semicolon.
like
";C:\Program Files\Java\jre7\bin"

Categories