anderZubi
anderZubi

Reputation: 6424

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?

Upvotes: 13

Views: 37198

Answers (12)

Mehrshad Farzaneh
Mehrshad Farzaneh

Reputation: 694

Open studio64 instead of studio

enter image description here

Upvotes: 0

Harshid
Harshid

Reputation: 1

Open the Installer and download it again and you can select delete previous versions to clear confusion.

Upvotes: 0

Zia
Zia

Reputation: 755

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:

  1. Go to this path "C:\Program Files\Android", there you will find two Android Studio Folders. enter image description here

  2. Find which one is latest: (Latest name wold be "Android Studio1") && (Old version would be Android Studio)

  3. 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 enter image description here

Upvotes: 0

Ug Hits
Ug Hits

Reputation: 1

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

Upvotes: 0

Jeberdson Abraham
Jeberdson Abraham

Reputation: 571

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.

Upvotes: 0

Priyanka
Priyanka

Reputation: 3709

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.

  1. I downloaded the studio and install it in the new directory.

  2. After installation success, copy all the files & folders and paste and replace it into old location where studio was installed.

Upvotes: 1

Sazzad Hissain Khan
Sazzad Hissain Khan

Reputation: 40255

Please follow the below steps,

  1. Go to My Computer -> Properties -> Advance System Settings
  2. System properties window will appear
  3. Go to Advance tab -> Environment Variables -> New
  4. Add or update JAVA_HOME path as expected.
  5. Optionally you can also add or update JDK_HOME if you have JDK installed in your PC

enter image description here

Upvotes: -1

Grime
Grime

Reputation: 61

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.

Upvotes: 0

Aaryan Saraswat
Aaryan Saraswat

Reputation: 21

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.

Upvotes: 2

31rtqewr
31rtqewr

Reputation: 19

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.

Upvotes: -1

Jay Poojara
Jay Poojara

Reputation: 99

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.

Upvotes: 2

Kajal
Kajal

Reputation: 226

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)

Upvotes: 0

Related Questions