"The system cannot find the path specified." error message when trying to start GlassFish with asadmin
Asked Answered
M

5

20

I tried to follow The Java EE 6 Tutorial and start GlassFish with the command below. But I got an error message. How to solve this?

C:\glassfish3\bin>asadmin start-domain --verbose
The system cannot find the path specified.
Metaprotein answered 18/10, 2012 at 13:45 Comment(0)
M
7

I fixed this issue by editing glassfish3\glassfish\config\asenv.bat as described in domain1 not configured -- The system cannot find the path specified

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

Metaprotein answered 18/10, 2012 at 14:25 Comment(0)
M
37
  1. Go to asenv.bat file in config directory
  2. remove line set AS_JAVA="C:/Program Files(x86)/Java/"
  3. retry asadmin.

It will work this time!.

Merrile answered 25/1, 2013 at 11:29 Comment(3)
As long as you have the system variable 'path' set correctly ofcourse ;)Billet
I dont have sth like "set AS_JAVA="C:/P... in my asenv.bat file. Is there sth wrong?Adjournment
No, that variable just says where to look for java. if it is not set, Glassfish will follow the default location set in PATH system variable. Make sure to set your PATH variable correctly pointing to java location if your case is the latter one.Merrile
M
7

I fixed this issue by editing glassfish3\glassfish\config\asenv.bat as described in domain1 not configured -- The system cannot find the path specified

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

Metaprotein answered 18/10, 2012 at 14:25 Comment(0)
P
3

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)

Now open asenv.bat in notepad.

Make the value of AS_JAVA same as JAVA_HOME environment variable.

Now open command prompt and go to the bin folder and run 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

Piracy answered 25/5, 2013 at 18:28 Comment(0)
J
0

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.

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".

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

%JAVA% -jar "%~dp0..\glassfish\modules\admin-cli.jar" %*

I could manually set %JAVA% right, but how to set nicer correction?

Jac answered 17/12, 2012 at 15:7 Comment(0)
U
0

Set your correct Java path in:

<glassfish_home>\glassfish\config\osgi.properties

e.g.

set AS_JAVA=C:\Program Files\Java\jdk1.7.0_80

Note: follow Oracle glassfish's release notes for the supported JDKs

Unplumbed answered 28/1, 2021 at 13:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.