Software Archive
Read-only legacy content
17061 Discussions

Control Java version for Android build

Brandt__Lars
New Contributor I
314 Views

Hi 

I'm trying to install cordova-plugin-photo (https://github.com/domax/cordova-plugin-photos) but I'm getting this error:

Compiling with JDK Java compiler API.
.../cordova_project/platforms/android/src/com/domax/cordova/Photos.java:201: error: try-with-resources is not supported in -source 1.6
		try (final Cursor cursor = query(
		    ^
  (use -source 7 or higher to enable try-with-resources)
.../cordova_project/platforms/android/src/com/domax/cordova/Photos.java:361: error: diamond operator is not supported in -source 1.6
		final List<T> result = new ArrayList<>();
		                                     ^
  (use -source 7 or higher to enable diamond operator)
 
The plug-in readme does state that Java 7 or higher is needed, and can be controlled with Gradle script, 
but what to do in XDK?

I was hoping to find some magic tags to put in intelxdk.config.additions.xml, but haven't been able to find anything.

 

Lars B.

 

0 Kudos
1 Reply
PaulF_IntelCorp
Employee
314 Views

You cannot control those parameters with our build system. That is one of the compromises of using a cloud-based build system. If you need that level of control you are better off using Cordova CLI and building directly yourself, on your local development system.

0 Kudos
Reply