java add-user.bat on JBoss-as-7.1.1.Final,系统找不到指定的路径

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17172611/
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-11-01 01:12:14  来源:igfitidea点击:

add-user.bat on JBoss-as-7.1.1.Final,The system cannot find the path specified

javajboss7.x

提问by Sboniso

i've installed jboss-as-7.1.1.Final on my windows 7. the installation was successfull, and i can see the server running on http:/localhost:8080/

我已经在我的 Windows 7 上安装了 jboss-as-7.1.1.Final。安装成功,我可以看到服务器在 http://localhost:8080/ 上运行

But the problem is I am trying to add the users through add-user.bat file. It shows a error message like

但问题是我试图通过 add-user.bat 文件添加用户。它显示一条错误消息,如

C:\jboss-as-7.1.1.Final\bin>add-user.bat
The system cannot find the path specified.
Press any key to continue . . .

C:\jboss-as-7.1.1.Final\bin>add-user.bat
系统找不到指定的路径。
按任意键继续 。. .

If I remove @echo offfrom the top of the script I see

如果我@echo off从脚本的顶部删除,我会看到

> if "x" == "x" (set "JBOSS_MODULEPATH=C:\jboss-as-7.1.1.Final \modules" )   
> "C:\java\jre7\bin\bin\java" -jar "C:\jboss-as-7.1.1.Fina l\jboss-modules.jar"
       -mp "C:\jboss-as-7.1.1.Final\modules" org.jboss.as .domain-add-user
The system cannot find the path specified.   
> if "x" == "x" pause   
Press any key to continue . . .

I have set JBOSS_HOMEand JAVA_HOMEin environmental variables of my system.
Can any one please help to resolve this?

我已JBOSS_HOMEJAVA_HOME我的系统的环境变量。
任何人都可以帮助解决这个问题吗?

回答by Rup

You've set your JAVA_HOMEvariable wrong. You've set it to

你的JAVA_HOME变量设置错了。你已经设置为

JAVA_HOME=C:\java\jre7\bin

whereas you want it without the bin directory, i.e. just

而你想要它没有 bin 目录,即只是

JAVA_HOME=C:\java\jre7

However it's my recollection that JBoss needs a JDK, not a JRE. If that works, great; if not, you'll need to download an install a JDK insteadand when you've installed that, set JAVA_HOME to the root path of the JDK install, e.g.

但是,我记得 JBoss 需要 JDK,而不是 JRE。如果那行得通,那太好了;如果没有,则需要下载安装JDK,安装后,将 JAVA_HOME 设置为 JDK 安装的根路径,例如

JAVA_HOME=C:\java\jdk1.7.0_25

回答by Sai prateek

The one word solution:

一字解决:

  1. set your java home value excluding bin folder like JAVA_HOME="C:\Program Files\java\jdk1.7"

  2. Use the java home in path section of system variable like ...;%JAVA_HOME\bin%

  3. Set the jboss home path like JBOSS_HOME="C:\jboss-as-7.1"

  1. 设置您的 java home 值,不包括 bin 文件夹,例如 JAVA_HOME="C:\Program Files\java\jdk1.7"

  2. 在系统变量的路径部分中使用 java home,如 ...;%JAVA_HOME\bin%

  3. 设置 jboss 主路径,如 JBOSS_HOME="C:\jboss-as-7.1"

the reason behind this is your add-user.bat file need correct path for java home and jboss home.

这背后的原因是您的 add-user.bat 文件需要 java home 和 jboss home 的正确路径。

回答by Sai prateek

You will probably need to add JAVA_HOME/bin to your PATH.

您可能需要将 JAVA_HOME/bin 添加到您的 PATH。

回答by anil

Add below lines for user variables:

为用户变量添加以下行:

variable = JAVA_HOME  value= C:\Program Files\Java\jdk1.7.0_79
variable = JBOSS_HOME value= E:\anil\jboss-as-7.1.1.Final
variable=path       value= C:\Windows\System32;%JAVA_HOME%\bin;%JBOSS_HOME%