简体   繁体   中英

Generics are not supported at language level '1.4'using Intellij & Java ME

I am using Java ME x IntelliJ for this project but I seem to be getting the Generics are not supported at language level '1.4' error for the below code block:

AccessPoint accessPoint = AccessPoint.of("WIFI",
                                                    new ConnectionOption<String>("ssid", "Net-1-AT"),
                                                    new ConnectionOption<char[]>("password", new char[]{'a', 't'}));
// specifically at the <String> and <char[]> areas

My configuration:
图片

Generics where introduced to Java with version 5 (in 2004), which corresponds to language level 1.5 . Unless you are working on a specific project where you are bound to level 1.5 , for some external reason, you should use a more recent version (8, 11 or 14) because they are more secure and have the feature you are looking for.

J2ME is basically unsupported and has no support for newer language features. Write the code without generics.

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