Does Bluemix decompile java 8 application pipeline support?

Given the Bluemix declaration, java 8 support is supported. What do I need to do to get the java 8 application in the IBM Bluesmix build (jazzhub build and deploy) assembly.

I set the java8 environment variable and restarted the application using the following:

cf set-env <myApp> JBP_CONFIG_IBMJDK "version: 1.8.+"
cf restage <myApp>

The specific type of "builder" that I use is "Maven", and the errors I get are related to the new date and time classes in java8.

[ERROR] <...>/services/TestHelperService.java:[3,17] package java.time does not exist
[ERROR] <...>/services/TestHelperService.java:[37,17] cannot find symbol
[ERROR] symbol:   class LocalDateTime
[ERROR] location: class <...>.services.TestHelperService
+4
source share
4 answers

To use Java 8, you need to change the JAVA_HOME environment variable in the assembly shell command:

export JAVA_HOME=~/java8

For instance:

#!/bin/bash
#export JAVA_HOME=~/java8 - Bluemix have changed the java8 location
export JAVA_HOME=/opt/IBM/java8
mvn -B package
+9
source

Java8 Bluemix Jazz. $JAVA_HOME . $PATH.

export JAVA_HOME=/opt/IBM/java8
export PATH=$JAVA_HOME/bin:$PATH

maven java8.

+1

, script

#!/bin/bash
echo "Java Home before $JAVA_HOME"
export JAVA_HOME=~/java8
echo "Java Home after $JAVA_HOME"
#mvn -B package -DskipTests
#mvn -B package

, , JAVA_HOME "export".

Checking out Revision 86514c6dc277b6903fcd6f51ca7c97ea733b1d42 (detached)
[ba6eba91-33a3-4b67-8efd-48962cf063ba] $ /bin/bash /tmp/hudson7007424628517212775.sh
Java Home before /home/jenkins/java
Java Home after /home/jenkins/java
Base artifact directory /home/jenkins/workspace/e92a4db8-6702-d006-0cdc-2a827a4e78a5/ba6eba91-33a3-4b67-8efd-48962cf063ba/target does not exist or is not a valid directory.
[xUnit] [INFO] - Starting to record.
[xUnit] [INFO] - Processing JUnit
[xUnit] [INFO] - [JUnit] - No test report file(s) were found with the pattern 'target/surefire-reports/TEST-*.xml' relative to '/home/jenkins/workspace/e92a4db8-6702-d006-0cdc-2a827a4e78a5/ba6eba91-33a3-4b67-8efd-48962cf063ba' for the testing framework 'JUnit'.  Did you enter a pattern relative to the correct directory?  Did you generate the result report(s) for 'JUnit'?
[xUnit] [ERROR] - No test reports found for the metric 'JUnit' with the resolved pattern 'target/surefire-reports/TEST-*.xml'. Configuration error?.
[xUnit] [INFO] - There are errors when processing test results.
[xUnit] [INFO] - Skipping tests recording.
Finished: SUCCESS
0

, JAVA_HOME /opt/IBM/java 8 script ( 2016-05-04):

#!/bin/bash
 echo "Java home before: $JAVA_HOME"
 export JAVA_HOME=/opt/IBM/java8
 echo "Java home after: $JAVA_HOME"
 mvn -B package

:

Java home before: /opt/IBM/java
Java home after: /opt/IBM/java8

, JBP_CONFIG_IBMJDK ": 1.8. +" (cf set-env myApp JBP_CONFIG_IBMJDK "version: 1.8.+" env: section of manifest.yml) ( ) buildpack: java_buildpack manifest.yml. 2015 java_buildpack JDK8.

The last thing you need to know is to change the original version of maven-compiler-plugin in pom.xml, of course, but it is not specific to Bluemix.

<project>
  [...]
  <build>
    [...]
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>(whatever version is current)</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
    </plugins>
    [...]
  </build>
  [...]
</project>
0
source

All Articles