windows “该系统找不到指定的路径。” 尝试使用 asadmin 启动 GlassFish 时出现错误消息
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12956167/
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
"The system cannot find the path specified." error message when trying to start GlassFish with asadmin
提问by Jonas
I tried to follow The Java EE 6 Tutorialand start GlassFish with the command below. But I got an error message. How to solve this?
我尝试遵循Java EE 6 教程并使用以下命令启动 GlassFish。但我收到一条错误消息。如何解决这个问题?
C:\glassfish3\bin>asadmin start-domain --verbose
The system cannot find the path specified.
采纳答案by Jonas
I fixed this issue by editing glassfish3\glassfish\config\asenv.bat
as described in domain1 not configured -- The system cannot find the path specified
我通过glassfish3\glassfish\config\asenv.bat
按未配置的域 1 中所述进行编辑来解决此问题-- 系统找不到指定的路径
then I got an error because no domains existed, that was solved by editing glassfish3\bin\asadmin.bat
as described in Oracle Glassfish "There is no Domain" Issue Fix Solution
然后我收到一个错误,因为不存在域,这是通过编辑解决的glassfish3\bin\asadmin.bat
,如Oracle Glassfish“没有域”问题修复解决方案中所述
回答by shifu
- Go to
asenv.bat
file in config directory - remove line
set AS_JAVA="C:/Program Files(x86)/Java/"
- retry
asadmin
.
- 转到
asenv.bat
配置目录中的文件 - 删除线
set AS_JAVA="C:/Program Files(x86)/Java/"
- 重试
asadmin
。
It will work this time!.
这一次会奏效的!。
回答by Pritish Shah
Hi I was facing the same issue. I am able to resolve the same issue by following below steps:
嗨,我面临同样的问题。我可以通过以下步骤解决同样的问题:
Go to \glassfish\config (Note: In my case it is c:\glassfish3\glassfish\config)
转到 \glassfish\config(注意:在我的情况下是 c:\glassfish3\glassfish\config)
Now open asenv.bat in notepad.
现在在记事本中打开 asenv.bat。
Make the value of AS_JAVA same as JAVA_HOME environment variable.
使 AS_JAVA 的值与 JAVA_HOME 环境变量相同。
Now open command prompt and go to the bin folder and run asadmin start-domain domain1.
现在打开命令提示符并转到 bin 文件夹并运行 asadmin start-domain domain1。
If you are getting error that no domain exist then create new domain by following below link: http://docs.oracle.com/cd/E19776-01/820-4497/create-domain-1/index.html
如果您收到不存在域的错误,请通过以下链接创建新域:http: //docs.oracle.com/cd/E19776-01/820-4497/create-domain-1/index.html
回答by Reijo Korhonen
I got this error, when installing Java EE (which includes GlassFish) using 64 bit windows 7. As a reference installing same Java EE latest to my 64 bit Linux worked well and I could see how it set default domain up.
我在使用 64 位 Windows 7 安装 Java EE(包括 GlassFish)时遇到此错误。作为参考,在我的 64 位 Linux 上安装相同的最新 Java EE 运行良好,我可以看到它是如何设置默认域的。
It seems that in my 64 bit Window 7 asadmin.bat looks my java from "C:\Program Files (x86)\Java\bin\java" even if I have installed 64 bit version in "C:\Program Files\Java\jdk1.7.0_10\bin".
似乎在我的 64 位 Window 7 asadmin.bat 中,即使我已经在“C:\Program Files\Java\ jdk1.7.0_10\bin”。
asadmin.bat runs first "%~dp0..\glassfish\config\asenv.bat" and then studies where if guesses java is. There is something odd in this, almost in my configuration, but I can't fix this nicely
asadmin.bat 首先运行“%~dp0..\glassfish\config\asenv.bat”,然后研究 if 猜测 java 在哪里。这有点奇怪,几乎在我的配置中,但我无法很好地解决这个问题
%JAVA% -jar "%~dp0..\glassfish\modules\admin-cli.jar" %*
%JAVA% -jar "%~dp0..\glassfish\modules\admin-cli.jar" %*
I could manually set %JAVA% right, but how to set nicer correction?
我可以手动设置 %JAVA% 正确,但如何设置更好的校正?