简体   繁体   中英

Issue In Compiling/Deploying Java Adapter in MFP 7.1 using ANT

I have the following java version which is a must to be used in my project:

Hussams-MacBook-Pro:buildscripts SamEddin$ java -version
java version "1.8.0_112-ea"
Java(TM) SE Runtime Environment (build 1.8.0_112-ea-b04)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b04, mixed mode)

I'm using this ant to compile my java adapter which is giving a success result:

    <taskdef resource="com/worklight/ant/defaults.properties">
        <classpath>
          <pathelement location="${WL_PATH}/worklight-ant-builder.jar"/>
        </classpath>
      </taskdef>

      <path id="server-classpath">
                <fileset dir="${WL_PATH}" includes="worklight-jee-library.jar" />
                <fileset dir="${WL_PATH}" includes="**/*.jar" />
                <fileset dir="${basedir}/source/${project.name}/adapters/GRSValidationAdapter/lib" includes="**/*.jar"/>

      </path>

 <javac
      srcdir="${basedir}\source\${project.name}\adapters\GRSValidationAdapter\src\ca\manulife\adapter"
      classpathref="server-classpath"
      destdir="${basedir}\AdapterClasses"
      verbose="true"
      includeantruntime="false"
      target="1.7"
    />

    <target name="build-adapter">

        <adapter-builder 
        destinationfolder="bin" 
        classpathref="server-classpath" 
        folder="${basedir}\source\${project.name}\adapters\GRSValidationAdapter"
            />
    </traget>

However, when I deploy the adapter to the server I'm getting the following error:

11:04:21:764 EDT] 000000b1 StatusMessage E StatusMessage createStatusMessage Preparation to deploy adapter 'GRSValidationAdapter' failed.
java.lang.Error: The adapter was built with a later version of Java than is used to run the server.

How can I force my ant to compile the Java classes in my adapter to use 1.7.

Notes:

I have both 1.7 and 1.8 is installed.

Server version: 7.1.0.00.20160401-2103

在Linux Bash Profile下设置JAVA_HOME / PATH变量,例如:export JAVA_HOME = / usr / java / jdk1.7 / bin / java-> of coz取决于您的Java路径

If you are running WebSphere Application Server 8.5.5.5 or later, then you can use java 1.8 on your server.

Use this page to see what version of Java ships with each version. From there you can either upgrade your server, and/or change your WAS configuration to use your installed Java 1.8.

Make sense?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM