Use -source 7 or higher to enable diamond operator

(Pranay Raj) #1

when i try to buid an extension it shows
[mkdir] Created dir: C:\mit-cml-appinventor-sources-308f1f3\appinventor\comp onents\build\classes\AndroidRuntime
[javac] Warning: com\google\appinventor\components\runtime\Animations_View.j ava modified in the future.
[javac] Compiling 316 source files to C:\mit-cml-appinventor-sources-308f1f3 \appinventor\components\build\classes\AndroidRuntime
[javac] warning: [options] bootstrap class path not set in conjunction with -source 1.5
[javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
[javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
[javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
[javac] C:\mit-cml-appinventor-sources-308f1f3\appinventor\components\src\co m\daimajia\androidanimations\library\ error: diamond operator is n ot supported in -source 1.5
[javac] private List<Animator.AnimatorListener> callbacks = new Arra yList<>();
[javac] ^
[javac] (use -source 7 or higher to enable diamond operator)
[javac] 1 error
[javac] 4 warnings


(Diego Barreiro Pérez) #5

Try using our IDE, I think it will work there

(Pranay Raj) #6

i used it
it shows same error

(Diego Barreiro Pérez) #7

Can you send me the source code of the extension?
I would like to take a look to it

(Diego Barreiro Pérez) #10

Which Java version are you using?

(Pranay Raj) #12

java jdk1.8.0_181

(Diego Barreiro Pérez) #13

You have some errors in your code:

  • description = Animation view extension has to be description = "Animation view extension"
  • iconName = “” is not a supported icon. You need to find a file URL which ends in .png, .jpg or whatever, not Google Drive

And then, it looks like the error comes from the library you are using, not from your code:

(Pranay Raj) #14

I change my code but it shows Use -source 7 or higher to enable diamond operator
what it means

(Pavitra Golchha) #15


This is no lib bug :smiley:
This means he not use the correct java version.
Too why is there a local path?!
And why is in the path the Man app inventor source?

(Pranay Raj) #19

Thanks To all For replying but I am confused
who is right


Read this:

Then you will know who is right.


You have to learn how extensions and java works.
I cant help you.

All I can say is you have to look at the error message.

You did not imported a library that your code needs.
import android.animation.ObjectAnimator;

(Pranay Raj) #23

ok thanks
a lot Mika