Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 570344 - ERROR: Cannot start Android Studio\nNo JDK found.
Summary: ERROR: Cannot start Android Studio\nNo JDK found.
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal major with 1 vote (vote)
Assignee: Jason Zaman
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-31 08:55 UTC by augustin
Modified: 2016-01-01 19:36 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description augustin 2015-12-31 08:55:25 UTC
I couldn't start android-studio:
 $ /usr/bin/android-studio
 ERROR: Cannot start Android Studio\nNo JDK found. Please validate either STUDIO_JDK, JDK_HOME or JAVA_HOME environment variable points to valid JDK installation.


although I had JDKs installed:

# java-config --list-available-vms
 The following VMs are available for generation-2:
 1) IcedTea JDK 7.2.6.3 [icedtea-7]
 *) IcedTea JDK 7.2.6.3 [icedtea-bin-7]


Some research on the interwebs led me to add an environment variable:
vi /etc/environment 
Added: 
JAVA_HOME=/usr/lib/jvm/icedtea-7
JDK_HOME=/usr/lib/jvm/icedtea-7

Obviously, those variables will become obsolete when a new major version comes out.

Installing android-studio should, by default, set the proper environment variables in the proper places so that android-studio can be started without running into this problem.

I start android-studio in a chrooted environment. I don't know if it's relevant.
Comment 1 augustin 2015-12-31 08:56:37 UTC
What I mean is that manually adding the environment variables to /etc/environment solved the problem.
Comment 2 augustin 2015-12-31 09:22:42 UTC
Note that the package dev-util/android-sdk-update-manager has the following post-installation note, warning to run env-update and source /etc/profile in any open shells. 
The android-studio package should have the same warning. 


 * Messages for package dev-util/android-sdk-update-manager-23-r1:
 * The Android SDK now uses its own manager for the development environment.
 * Run 'android' to download the full SDK, including some of the platform tools.
 * You must be in the android group to manage the development environment.
 * Just run 'gpasswd -a  android', then have  re-login.
 * See http://developer.android.com/sdk/adding-components.html for more
 * information.
 * If you have problems downloading the SDK, see https://code.google.com/p/android/issues/detail?id=4406
 * You need to run env-update and source /etc/profile in any open shells
 * if you get an SWT error.
Comment 3 Alex Xu (Hello71) 2016-01-01 19:32:08 UTC
as explained in the handbook, you must source /etc/profile when entering a Gentoo chroot.
Comment 4 augustin 2016-01-01 19:36:15 UTC
Oh! :s
Thanks for that.
Sorry for the noise. :-/