在 JDK 1.7 的环境下开发 Android

December 10, 2014

Android

一直以来,我们都在 JDK 6 上面做 Android 的开发,不知道从什么时候开始,Google已经推荐使用 JDK 7 来开发 Andrid 应用了,特别是 Android 5.0 或者更高的版本,要求使用JDK 7 来开发。下面是今天从官方文档上找到的。昨天 Google 退出了 Android Stuido 的 release 版本,虽然被认为跟 xCode 比起来还有一定的差距,但是还是应该能看到 Google 的努力。我也下载了一个,准备体验一下,希望有惊喜。

Before you set up Android Studio, be sure you have installed JDK 6 or higher (the JRE alone is not sufficient)—JDK 7 is required when developing for Android 5.0 and higher. To check if you have JDK installed (and which version), open a terminal and type javac -version. If the JDK is not available or the version is lower than 6, go download JDK

目前我的环境还是 JDK 6,下午折腾一下。

更新一下折腾的结果:

  1. 没有 VPN 就先别折腾了
  2. VPN 速度不给力也先别折腾了
  3. 内存少也先别折腾了,我 T400 3G 的内存卡死了
  4. 条件都没问题的,好好折腾吧。

下面是对开发环境的系统需求,JDK 7 已经变成了要求了。原谅我在 Android 开发者官方被墙的日子,没有及时查看官方文档。

Windows

  • Microsoft® Windows® 8/7/Vista/2003 (32 or 64-bit)
  • 2 GB RAM minimum, 4 GB RAM recommended
  • 400 MB hard disk space + at least 1 G for Android SDK, emulator system images, and caches
  • 1280 x 800 minimum screen resolution
  • Java Development Kit (JDK) 7
  • Optional for accelerated emulator: Intel® processor with support for Intel® VT-x, Intel® EM64T (Intel® 64), and Execute Disable (XD) Bit functionality

Mac OS X

  • Mac® OS X® 10.8.5 or higher, up to 10.9 (Mavericks)
  • 2 GB RAM minimum, 4 GB RAM recommended
  • 400 MB hard disk space
  • At least 1 GB for Android SDK, emulator system images, and caches
  • 1280 x 800 minimum screen resolution
  • Java Runtime Environment (JRE) 6
  • Java Development Kit (JDK) 7
  • Optional for accelerated emulator: Intel® processor with support for Intel® VT-x, Intel® EM64T (Intel® 64), and Execute Disable (XD) Bit functionality

On Mac OS, run Android Studio with Java Runtime Environment (JRE) 6 for optimized font rendering. You can then configure your project to use Java Development Kit (JDK) 6 or JDK 7.

Linux

  • GNOME or KDE desktop
  • GNU C Library (glibc) 2.11 or later
  • 2 GB RAM minimum, 4 GB RAM recommended
  • 400 MB hard disk space
  • At least 1 GB for Android SDK, emulator system images, and caches
  • 1280 x 800 minimum screen resolution
  • Oracle® Java Development Kit (JDK) 7

Tested on Ubuntu® 12.04, Precise Pangolin (64-bit distribution capable of running 32-bit applications.

--- EOF ---

评论

  1. weifengxiatian weifengxiatian

    我这边还是用1.6来, 结果更新eclipse sdk 到5.0发现 需要jdk 7……然后各种别扭。请教lz,如果我现在用1.7 做 Android 的开发,会不会有之前的有影响?

    1. 我也刚换到1.7上,到目前为止,没发现有什么影响。

添加新评论