Many users ubuntu since version 12.xx cannot install java jdk via apt-get and then install manually. Download jdk for linux from oracle.com website and extract into lib (e.g /usr/lib/jvm/jdk1.xxx), then register java with update-alternatives.
For common java application which self search java installation such as Netbeans IDE, everything gona be ok, but when i try to run android-studio based on intelij, i got error “Startup Error, Unable to detect graphics environment”. Then I searching how to solve this problem via uncle google. And there is no answer for my case.
Almost 3 days “Unable to detect graphics environment” always in my head. And this morning I found the realy very simple solution: I forgot to set JAVA_HOME and PATH for my ubuntu… and here I go :
Via terminal, set JAVA_HOME to where you install java:
Then set PATH for JAVA_HOME:
Now you can launch android studio like this:
This, somethins i need to see in my ubuntu:
Ha ha ha … very not cool … I think caused by complex or something big, but only JAVA_HOME not configured yet… make me depressed for a two days…. For you with same trouble with me, “tepok jidat dulu”