braintree/braintree_java

Maven failed to build this java package

BrianHo888 opened this issue · 6 comments

2018-11-02_11-07-31

General information

  • SDK/Library version: JAVA 11
  • Environment: Sandbox
  • Language, language version, and OS: Java 11 on Windows 7

Issue description

Maven failed to build this package. Please see attachment for detail. Based on the ReadMe, I enter "mvn package" command to build this package with no success. Any suggestion?

Thanks,

SDK/Library version: JAVA 11

What version of the Braintree SDK are you trying to download? You put the version of Java you are using instead.

@BrianHo888 The issue does not seem to be related to the library itself, but rather to the javac provided by JDK 11. If you will try to compile any class, even one that does not belong to the project using plain javac compiler with 1.5 source/target parameters set you will get error message like this

warning: [options] bootstrap class path not set in conjunction with -source 5        
error: Source option 5 is no longer supported. Use 6 or later.                                                          
error: Target option 1.5 is no longer supported. Use 1.6 or later.         

You can check it on yourself by running command

javac SomeClass.java -source 1.5 -target 1.5

For sure you should be able to compile the library using JDK 8. Also suggestion from error message to force minimum version of source/target Java version 1.6 will do the trick.

There is JEP 182: Policy for Retiring javac -source and -target which should explain the root cause of the problem.

SDK/Library version: JAVA 11

What version of the Braintree SDK are you trying to download? You put the version of Java you are using instead.

I downloaded it from: https://github.com/braintree/braintree_java

@BrianHo888 The issue does not seem to be related to the library itself, but rather to the javac provided by JDK 11. If you will try to compile any class, even one that does not belong to the project using plain javac compiler with 1.5 source/target parameters set you will get error message like this

warning: [options] bootstrap class path not set in conjunction with -source 5        
error: Source option 5 is no longer supported. Use 6 or later.                                                          
error: Target option 1.5 is no longer supported. Use 1.6 or later.         

You can check it on yourself by running command

javac SomeClass.java -source 1.5 -target 1.5

For sure you should be able to compile the library using JDK 8. Also suggestion from error message to force minimum version of source/target Java version 1.6 will do the trick.

@BrianHo888 The issue does not seem to be related to the library itself, but rather to the javac provided by JDK 11. If you will try to compile any class, even one that does not belong to the project using plain javac compiler with 1.5 source/target parameters set you will get error message like this

warning: [options] bootstrap class path not set in conjunction with -source 5        
error: Source option 5 is no longer supported. Use 6 or later.                                                          
error: Target option 1.5 is no longer supported. Use 1.6 or later.         

You can check it on yourself by running command

javac SomeClass.java -source 1.5 -target 1.5

For sure you should be able to compile the library using JDK 8. Also suggestion from error message to force minimum version of source/target Java version 1.6 will do the trick.

Thanks for the clarification. It looks like I will need to fallback to JDK 8 and see if I can compile it. Oracle will end JDK 8 support in 1/2019. I upgraded to JDK 11 from https://www.oracle.com/technetwork/java/javase/overview/index.html

This should no longer be an issue as of 2.96.0