oracle weblogic.Deployer 位置

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19484457/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 02:01:20  来源:igfitidea点击:

weblogic.Deployer location

oracleweblogicweblogic11g

提问by GarlicBread

I'm using WebLogic Server version 10.3.6.0 and have been tasked with writing some scripts to automatically deploy Java applications.

我使用的是 WebLogic Server 版本 10.3.6.0,并负责编写一些脚本来自动部署 Java 应用程序。

I'm looking at the documentation for weblogic.Deployer but when I try and run it, I get the following error:

我正在查看 weblogic.Deployer 的文档,但是当我尝试运行它时,出现以下错误:

Error: Could not find or load main class weblogic.Deployer

I have run the setWLSEnv.sh script in server/bin of the Server's installation directory, which sets PATH and CLASSPATH environment variables. My understanding was that weblogic.Deployer was part of server/lib/weblogic.jar, and that is being set in the script as part of the CLASSPATH variable.

我已经在服务器安装目录的 server/bin 中运行了 setWLSEnv.sh 脚本,它设置了 PATH 和 CLASSPATH 环境变量。我的理解是 weblogic.Deployer 是 server/lib/weblogic.jar 的一部分,并且在脚本中设置为 CLASSPATH 变量的一部分。

How could I find out where the weblogic.Deployer class is located?

我怎样才能找到 weblogic.Deployer 类的位置?

Thanks in advance for any assistance.

在此先感谢您的帮助。

回答by Kamiel Ahmadpour

And the $CLASSPATH is where your weblogic.jar is located:

$CLASSPATH 是您的 weblogic.jar 所在的位置:

~/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar

(replace ~ with your machine path)

(用你的机器路径替换 ~ )

So the whole code will be something like this:

所以整个代码将是这样的:

>java -cp ~/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar weblogic.Deployer -adminurl ...

Alternatively add ~/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jarin your CLASSPATHvariable inside the ENVIRONMENTparameters. In case it doesn't exist create one. And then just execute the command:

或者~/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar,在ENVIRONMENT参数中添加CLASSPATH变量。如果它不存在创建一个。然后只需执行命令:

>java weblogic.jar weblogic.Deployer -adminurl ...

By adding it permanently into CLASSPATH we can use the help option of the command as below:

通过将其永久添加到 CLASSPATH 中,我们可以使用命令的帮助选项,如下所示:

>>java weblogic.Deployer -help

回答by GarlicBread

Got it - just need to specify the classpath variable when executing the script:

明白了 - 只需要在执行脚本时指定类路径变量:

java -cp $CLASSPATH weblogic.Deployer