简体   繁体   中英

Android studio and JDK

I'm working with android studio 1.1.0 and JDK 8. Currently I'm working with regular expressions, but my android studio cannot resolve the method Matcher.group(String name), it can only access Matcher.group() and Matcher.group(int num).
Did anyone encounter the same problem? Are there any fixies?
This is really annoying because if I inspect the external libraries I can actually find the class Matcher which contains the requested method. I tried by forcing the build on 1.7 or 1.8, but nothing works.

Thank you in advance

This is not supported by Android. See the documentation of the Android version of java.util.regex.Matcher at

http://developer.android.com/reference/java/util/regex/Matcher.html

The important thing to remember is that irrespective of which JDK is being used, you are not targeting Java, but rather the Android platform, so you only have the subset of Java functionality implemented there. The method you want to use was introduced in Java 1.7, and has not (as of this writing) been included in Android.

Possibly that might change at some point in the future, or it might not.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM