What mean java -cp in bash and how to rewrite it in batch

bash batch-file jenkins weblogic wlst

285 观看

1回复

109 作者的声誉

Hello I need to write Batch script to deploy webapp to Weblogic server domain via WLST in Jenkins. In this article Bash script to deploy webapp to Weblogic server domain via WLST written code in bash. I don't understand what mean "/usr/bin/java -cp ***.jar ... " and how to rewrite it in bath script.

#!/bin/bash
HOST_NAME=${1-localhost}
HOST_USER=${2-weblogic}
HOST_PASS=${3-welcome1}
HOST_PORT=${4-7001}
SCRIPT_HOME="$(dirname $(readlink -f $0))"
WL_JAR="${SCRIPT_HOME}/middleware/wlserver_10.3/server/lib/weblogic.jar"
JAM_JAR="myapp.war"

function agentDeployer()
{
 /usr/bin/java -cp ${WL_JAR} weblogic.Deployer -adminurl t3://${HOST_NAME}:${HOST_PORT} -user ${HOST_USER} -password ${HOST_PASS} -targets ${SERVER_LIST} -deploy -upload ${JAM_JAR}
}
agentDeployer
作者: Vadim 的来源 发布者: 2017 年 12 月 27 日

回应 1


1

410 作者的声誉

决定

-cp stands for Class Path,you specify the locations of the class needed by the application
java- cp ==>java will search to find the class files as they are needed by the program.

You don't need to rewrite in batch script, i mean the command java -cp, because it's the same.

Good Luck !!

作者: Hatim 发布者: 2017 年 12 月 27 日
32x32