简体   繁体   中英

Zxing Library project import error

as this duplicate question does not get any acceptable or correct answer so i raised that question again.... please i am trying to import Zxing library project in my workspace- but i am getting problem that it gets stuck or conflicted with jre1.6 and jre 1.7.. in library project code- FORMATS_FOR_MODE = new HashMap<>(); those line gives error that- '<>' operator is not allowed for source level below 1.7 and if i change the project compliance and jre to 1.7 then it will give error- Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android Tools > Fix Project Properties. Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android Tools > Fix Project Properties.

please tell me if any one solved this problem, i am stucked very badly thanks in advance... and this is not the duplicate question as it related to library import...

You could manually "downgrade" the code to Java 6.0 if you don't want to follow the answers in the other questions.

  • Replace <> with <ProperType> (<- not the String "ProperType", but the proper type of your generic class)
  • Replace switch on Strings with `if(foo.equals(bar)){}else if(foo.equals(bar2)...``

If I remember correctly that are the only relevant "syntax changes" you need to do.

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