androidstudio set java version 1.7

为君一笑 提交于 2019-12-19 17:41:43

问题


I'm trying to use java version 1.7 with android studio but unfortunately it is not working properly... If set the version in File->Other settings -> Default project structure to

  Project SDK:
  java version 1.7.0_06

  Project language level:
  7.0 Diamonds, ARM, multi-catch

But when I use a switch-statement with a string I get an error which should be possible in java 1.7, so do I need to set any other settings?


回答1:


No... there is no settings to change. Android SDK don't support full java 7 syntax, so you can't use it.

Note that java.nio.* (new in java 7 API) is supported by latest android version.




回答2:


You can change it in new Android studio version(0.8.X)

FIle-> Other Settings -> Default Settings -> Compiler (Expand it by clicking left arrow) -> Java Compiler -> You can change the Project bytecode version here




回答3:


You can change jdk version from File > Other settings > Default Project structure. Then JDK location:



来源:https://stackoverflow.com/questions/18443403/androidstudio-set-java-version-1-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!