2

Am getting this error in Android Studio:

Error:could not find main class com/intellij/idea/main

I tried all the tips like:

  1. I set the variable JAVA_HOME as well as JDK_HOME
  2. Generally for 64bit installation default path will be c:\Program Files (x86)\Java\jdk1.7.0_71

  3. 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 commands work )

Still Android Studio is not working. Please help I am trying back 2 weeks but nothing helped.

Ojonugwa Jude Ochalifu
  • 26,627
  • 26
  • 120
  • 132
  • Try to re-download and reinstall. – Jonas Czech May 17 '15 at 21:13
  • 1
    I know this has been asked long time ago but just to clarify: "Generally for 64bit installation default path will be c:\Program Files (x86)\Java\jdk1.7.0_71" No, the one with (x86) is for 32-bit applications – developer10 Jul 16 '16 at 10:28

3 Answers3

0

Try adding "\bin“ to path. Or maybe just reinstall Java & android studio.

0

The best thing that worked for me

was delete the variables envioroment JAVA_HOME JDK_HOME STUDIO_OPTIONS etc,

all the variables related to ANDROID STUDIO AND JAVA

I realized because I have another computer with android studio installed and working perfectly so I started to look up how were the variables there and it turned out that the computer didn't have any of those variables so I knew what was the problem

however, I'll attach a screenshot of my variable environment state

enter image description here

If this help you please i bet you like this post sorry if my english is a little bad but all are learning from each other

Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
-2

All you have to do is

  • open Control panel
  • open Programs and Features
  • select "run programs made for previous versions of windows"
  • then choose Android Studio

After a while, your computer shall ask you to test the program. In my case it did really work

  • then it will ask you to save the new settings or abort, just save it.

... and you're done!

Sevle
  • 3,109
  • 2
  • 19
  • 31
ziad
  • 1