Use -source 7 or higher to enable diamond operator

when i try to buid an extension it shows
AndroidRuntime:
[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\YoYo.java:102: 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

BUILD FAILED

Try using our IDE, I think it will work there

i used it
it shows same error

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

Which Java version are you using?

java jdk1.8.0_181

You have some errors in your code:

  • description = Animation view extension has to be description = "Animation view extension"
  • iconName = “https://drive.google.com/open?id=1_J49XeERpMmw1rKAmQqZKlDSqrAAGytt” 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:

1 Like

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

1 Like

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?

1 Like

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.
Example:
import android.animation.ObjectAnimator;

1 Like

ok thanks
a lot Mika