I am trying to install Android Studio on Ubuntu 18.04.
I downloaded and extracted Android Studio 3.1, and was wondering which JDK version is the last supported by Android Studio.
According to Oracle JDK page, JDK 8 has reached EOL:
Oracle will not post further updates of Java SE 8 to its public download sites for commercial use after January 2019. Customers who need continued access to critical bug fixes and security fixes as well as general maintenance for Java SE 8 or previous versions can get long term support through Oracle Java SE Subscription or Oracle Java SE Desktop Subscription. For more information, and details on how to receive longer term support for Oracle JDK 8, please see the Oracle Java SE Support Roadmap.
I installed Oracle JDK 11.0.1 for my Android studio as it is latest, but it throws the error:
Error: Could not find or load main class com.intellij.idea.Main
Caused by: java.lang.ClassNotFoundException: com.intellij.idea.Main
When starting android studio.
java -version
Gives Output:
java version "11.0.1" 2018-10-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.1+13-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.1+13-LTS, mixed mode)
And
echo $JAVA_HOME
Gives Output
/usr/lib/jvm/jdk-11.0.1
Which JDK version should I use?
You should use the JDK version bundled with Android Studio; you don't need a separate JDK installation. The bundled JDK version is currently based on OpenJDK 8, but it's actively maintained by JetBrains, which backports security fixes and other improvements to that version.
Related
Android studio used to complaint about using OpenJDK and was recommending Oracle JDK. However with latest Android Studio, that prompt has gone (probably due to the legal dispute between both the companies).
I today installed Oracle JDK 1.8.0.92 and Android Studio 2.1.1 seems to be running faster, a noticeably faster.
Any idea what's the current status of Android studio with respect to Java 1.8 and also with respect to OpenJDK vs Oracle JDK.
Thanks
There is one main advantage of openJDK, and that is you can add ALPN jar into bootclasspath which is currently not supported by OrcaleJDK.
ALPN is basically used for http2 protocol when communicating with an http2 enabled Server.
In android that can be used with a library like okhttp.
Android studio -
updated sdk with android 21 , updated java to 1.7.0 . Whenever i try to compile with android L ( 21 ) , it throws this error and gradle sync is failed.
C:\Users\me>java -version
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
found similar question for mac -
Android Studio needs JDK 7 for Android-L mac
You have two options, you can just switch your compiled version back to 20 if you do not want all the goodness of SDK 21. To upgrade to JDK 7 for Windows, do this:
Download the Jave 7 exe from
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
Perform a straight forward install and take note of the installation folder such as C:\Program Files\Java\jdk1.7.0_71
Then click on File > Project Structure and point the JDK location to
the location of the JDK you just installed
I am trying to do the get started android app - there are two locations and two methods I have tried, both same result:
LoadLibrary failed with error 998:
Invalid access to memory location
Step 5 from this article.
Running the app from here.
I have installed the standalone adt app from the official SDK site.
Please note I initially had the 64-bit jdk installed AND installed the 64-bit adt standalone version. I received the same symptom. So I, subsequently, installed the 32-bit jdk and then installed the 32-bit adt standalone, and got the same issue.
adt version info
Android Developer Tools
Build: v21.0.1-543035
Java version
java version "1.6.0_37"
Java(TM) SE Runtime Environment (build 1.6.0_37-b06)
Java HotSpot(TM) Client VM (build 20.12-b01, mixed mode, sharing)
My machine info
Windows 7 Home Premium Service Pack 1
Studio XPS 7100
AMD Phenom(tm) II X6 1035T Processor 2.60 GHz
6.00 GB RAM
64-bit Operating System
Go to android-sdk/Tools and rename emulator-arm.exe to emulator.exe. You may make backup of current old emulator.exe
I am trying to install the ADT plugin on Eclipse, but it doesn't seem to be working. I tried using the ADT Bundle for Mac but I always get the error
dyld: unknown required load command 0x80000022
on the console. I tried both Eclipse Juno and Eclipse Indigo using the eclipse ADT plugin, it downloaded and installed the latter, but when I go in the Preferences, there is no 'Android' there... I'm using an iMac using Mac OS X v.10.5.8 (Leopard).
because something in the bundle is made specifically for a mac 10.6 and it isn't backwards compatible.
I'm having the same issue.
and here's my java
Device-873EF9:~ Tahj182$ java -version
java version "1.5.0_30"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_30-b03-389-9M3425)
Java HotSpot(TM) Client VM (build 1.5.0_30-161, mixed mode, sharing)
Device-873EF9:~ Tahj182$
Find out which Java version you have, it may be that your plugin requires a Java version.
Terminal:
$java -version
I would prefer to just use openjdk-6-jdk (version 6b20-1.9.1-1ubuntu3). But I'm just starting the Android SDK installation, so if Sun (Oracle) Java is really needed, I suppose now is the time to install it. Any advice?
I'm using JDK for working on Android and it's fine :)
java -version
java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.1) (6b20-1.9.1-1ubuntu3)
OpenJDK 64-Bit Server VM (build 17.0-b16, mixed mode)
And eclipse plugin too :)
I tried it and it is working. I built and ran my project without any errors. (If I encounter errors in the future, I'll know to try the Sun JDK.)
Thanks for the feedback.
BTW, I'm running Ubuntu 10.10, and
Eclipse Helios Service Release 1 Build id: 20100917-0705
My project targets Android 2.2.
It works so far.
But I'm just starting the Android SDK installation, so if sun java is really needed, I suppose now is the time to install it. Any advice?
The Dalvik cross-compiler expects Sun bytecode and will fail with OpenJDK-generated class files, by all reports. Also, I'm not sure if there are any issues with other tools, such as the Eclipse ADT plug-in. You are welcome to try it, though.
OpenJDK and the official Oracle compilers work using modern versions of the Android developer tools. Other Java compilers (e.g., GNU Classpath for Java) may or may not work.
For an "official" answer (by Andrew Hughes, who is "Free Java Software Engineer" at Red Hat, Inc):
We've never had any bug reports relating to this that I'm aware of.