openjdk android studio,Can Android Studio use OpenJDK or does it require Oracle JDK on Linux?

问题

Can Android Studio use OpenJDK 1.8 or does it require Oracle JDK on Linux? It would be easier to use OpenJDK because it comes installed on Fedora.

I'm running 64 bit Fedora-23 linux with Android Studio 1.5.1.build AI-141.2456560 on an Intel Haswell i7 chip.

$ java -version

openjdk version "1.8.0_72"

OpenJDK Runtime Environment (build 1.8.0_72-b15)

OpenJDK 64-Bit Server VM (build 25.72-b15, mixed mode)

$ ./java -version

java version "1.8.0_73"

Java(TM) SE Runtime Environment (build 1.8.0_73-b02)

Java HotSpot(TM) 64-Bit Server VM (build 25.73-b02, mixed mode)

$ uname -a

Linux localhost.localdomain 4.3.5-300.fc23.x86_64 #1 SMP Mon Feb 1 03:18:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

$ more build.txt

AI-141.2456560

回答1:

No, just as the android documentations says, Oracle JDK is required. I got a "null pointer exception" on render on when running a simple build of an empty project with openJDK. This error probably came from the IDE, not the build of the APK file.

After running studio with Oracle's JDK, it all worked properly with no change to the code.

Actually it gets more complicated than that because, I have both versions on my system. Oracle JDK is used to launch the studio.sh file, but inside studio I still have the OpenJDK specified under "Project Structure> JDK" as:

/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.72-4.b15.fc23.x86_64

I'll report back if this hybrid situation fails.

回答2:

I am using Android Studio since version 1.0 (currently 2.0 beta) on Fedora 64 bit (currently 23) and OpenJDK. It used to display a warning saying something like "OpenJDK is not supported, do not open bug reports if something goes wrong", I don't know if it it still does (I may have clicked on "Don't show this again").

There was also a warning about libinput but I think it is not related to OpenJDK.

Anyway in my case it works quite well, as far as I can remember I did not have to use special tricks. Obviously your mileage may vary.

来源:https://stackoverflow.com/questions/35741439/can-android-studio-use-openjdk-or-does-it-require-oracle-jdk-on-linux

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值