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

4

6

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/

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

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

If I remove @echo off from the top of the script I see

> 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_HOME and JAVA_HOME in environmental variables of my system.
Can any one please help to resolve this?

Plash answered 18/6, 2013 at 15:15 Comment(1)
I don't have a copy of that to hand. Can you look at the bat file and see what it's trying to do? Try commenting out the @echo off at the top of the script and running it again. It looks like it can't find your java though.Anthropophagite
A
11

You've set your JAVA_HOME variable wrong. You've set it to

JAVA_HOME=C:\java\jre7\bin

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

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 instead and when you've installed that, set JAVA_HOME to the root path of the JDK install, e.g.

JAVA_HOME=C:\java\jdk1.7.0_25
Anthropophagite answered 19/6, 2013 at 10:51 Comment(0)
L
4

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"

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

Liberalize answered 7/10, 2014 at 4:6 Comment(1)
Unfortunately, every time you update Java you have to go in and manually fix the JAVA_HOME environment variable. If you need to stay up to date with the latest updates of Java, this will happen frequently. Would be nice if the scripts were written so that if JAVA_HOME was not set, they would go search in "the usual places" to find the most recent version of Java installed on the system..Crumpled
C
2

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

Canaletto answered 18/6, 2013 at 15:24 Comment(3)
I'm not sure what could be the issue, but i don't think it's the java home. C:\Windows\System32>if "x" == "x" (set "JBOSS_MODULEPATH=C:\jboss-as-7.1.1.Final \modules" ) C:\Windows\System32>"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. C:\Windows\System32>if "x" == "x" pause Press any key to continue . . . here is the out put of my execution with the "@echo off" commented out. thank you in advance.Plash
What is your JBOSS_HOME? I had to set only JBOSS_HOME correctly and it works for me!Canaletto
C:\java\jre7\bin\bin\java Is that definitely right, i.e. you have a C:\java\jre7\bin\bin\java.exe? The two bins looks wrong to me. Shouldn't JAVA_HOME be a JDK not a JRE? ... and for multi-line output it would have been better to edit it into your question: as you can see posting it in a comment loses the formatting.Anthropophagite
Z
-1

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%
Zigrang answered 10/12, 2015 at 17:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.