• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Not able to Start JBoss(run.bat)

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
Im new to JBoss.
Im not able to start JBoss either from eclipse or the cmd prompt(Windows)
It says "Set Java_home to your local directory"
But i do not know how to set that particular path or where to do that.
Should i open the run.bat file in edit mode and edit manually?
How shud i do that.
I use Windows XP
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Praveen, welcome to Java Ranch!

I hope that you installed a JDK. The JAVA_HOME setting should identify the base directory for the JDK. Usually, the JDK install into a location such as c:\Programs Files\jdk1.6.0_15. (By the way, that is a very bad location - spaces in directory names tend to confuse some Java apps. I alwasy install into c:\apps.) In this case, I would set JAVA_HOME to "c:\Programs Files\jdk1.6.0_15".

If this does not help, post the contents of the command prompt window, starting with the run.bat command you entered.

By the way, chapter 1 for JBoss in Action (a free download from the book's web site) should get you started.
 
Praveen Orvakanti
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Peter,
I did install JDK 1.7 into c:\Programs Files\Java\JDK1.7
My problem is that i do not know wer and how to set the Java_home path in JBoss.
 
Praveen Orvakanti
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have set the JAVA_HOME variable but still JBoss isnt starting...

The cmd window says:


Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\246022>cd\

C:\>cd Program Files\jboss-5.0.1.GA\bin

C:\Program Files\jboss-5.0.1.GA\bin>run.bat
\";C:\Program Files\jboss-5.0.1.GA\bin" was unexpected at this time.
C:\Program Files\jboss-5.0.1.GA\bin>run.bat
\";C:\Program Files\jboss-5.0.1.GA\bin" was unexpected at this time.
C:\Program Files\jboss-5.0.1.GA\bin>run.bat
\";C:\Program Files\jboss-5.0.1.GA\bin" was unexpected at this time.
C:\Program Files\jboss-5.0.1.GA\bin>run.bat
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are running in problems because you have spaces in your path. Try placing the path within quotes, like this:

set JAVA_HOME="c:\Programs Files\Java\JDK1.7 "

Also, are you sure you want to use JDK 7? I haven't tried JBoss AS with it yet, not sure what problems you might run into. I would suggest installing JDK 6, and not into Program Files.

If this does not help, comment out the "echo off" statement at the start of run.bat, run it again, and post the output.
 
Praveen Orvakanti
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Peter,
I guess i haven't been clear with my question. How do i open this run.bat file in edit mode in windows and comment out the echo off part?
i have set the java_home variable through the 'My Computer' properties and then choosing the Environment variables part.
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Praveen Orvakanti wrote:How do i open this run.bat file in edit mode in windows and comment out the echo off part?



Right click on the file and open in a text editor like notepad.
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

set the java_home variable through the 'My Computer' properties


Make sure that it is JAVA_HOME, not java_home. Also, make sure that the value is within quotes.

How do i open this run.bat file in edit mode in windows and comment out the echo off part?


You're joking, right? What options to you see when you right-click the run.bat file within Explorer?
 
Praveen Orvakanti
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Peter,
I don see a edit option on right clicking the file. Anyway after editing the file i get the following message:

C:\Program Files\jboss-5.0.1.GA\bin>run.bat

C:\Program Files\jboss-5.0.1.GA\bin>//@echo off
The filename, directory name, or volume label syntax is incorrect.

C:\Program Files\jboss-5.0.1.GA\bin>rem ----------------------------------------
---------------------------------

C:\Program Files\jboss-5.0.1.GA\bin>rem JBoss Bootstrap Script for Windows

C:\Program Files\jboss-5.0.1.GA\bin>rem ----------------------------------------
---------------------------------

C:\Program Files\jboss-5.0.1.GA\bin>rem $Id: run.bat 63250 2007-05-30 13:22:21Z
dimitris@jboss.org $

C:\Program Files\jboss-5.0.1.GA\bin>set JAVA_HOME="C:\Program Files\Java\jdk1.7.
0"

C:\Program Files\jboss-5.0.1.GA\bin>if "Windows_NT" == "Windows_NT" (set "DIRNAM
E=C:\Program Files\jboss-5.0.1.GA\bin\" ) else (set DIRNAME=.\ )

C:\Program Files\jboss-5.0.1.GA\bin>pushd C:\Program Files\jboss-5.0.1.GA\bin\..


C:\Program Files\jboss-5.0.1.GA>if "x" == "x" (set "JBOSS_HOME=C:\Program Files\
jboss-5.0.1.GA" )

C:\Program Files\jboss-5.0.1.GA>popd

C:\Program Files\jboss-5.0.1.GA\bin>set DIRNAME=

C:\Program Files\jboss-5.0.1.GA\bin>if "Windows_NT" == "Windows_NT" (set "PROGNA
ME=run.bat" ) else (set "PROGNAME=run.bat" )

C:\Program Files\jboss-5.0.1.GA\bin>if "x" == "x" (set "JAVA_OPTS=-Dprogram.name
=run.bat" ) else (set "JAVA_OPTS= -Dprogram.name=run.bat" )
Files\Java\jdk1.7.0"" was unexpected at this time.
C:\Program Files\jboss-5.0.1.GA\bin>if "x"C:\Program Files\Java\jdk1.7.0"" == "x
" (
C:\Program Files\jboss-5.0.1.GA\bin>
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Praveen Orvakanti wrote:Files\Java\jdk1.7.0"" was unexpected at this time.



Praveen,

Please follow what Peter already mentioned (especially about not installing into Program Files or any other folder containing a space in its name):

Peter Johnson wrote:

Also, are you sure you want to use JDK 7? I haven't tried JBoss AS with it yet, not sure what problems you might run into. I would suggest installing JDK 6, and not into Program Files.




Peter Johnson wrote:
If this does not help, comment out the "echo off" statement at the start of run.bat, run it again, and post the output.



Praveen Orvakanti wrote:
C:\Program Files\jboss-5.0.1.GA\bin>//@echo off
The filename, directory name, or volume label syntax is incorrect.



By the way, for commenting lines in .bat file you cannot use java comment syntax. You should you "rem" similar to what you see in some of the lines in that .bat file.
 
Praveen Orvakanti
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jai,
Thank you for your prompt reply.

I have done as you have told me. And the message that i get now is as follows:

C:\Program Files\jboss-5.0.1.GA\bin>run.bat -b 172.20.60.126

C:\Program Files\jboss-5.0.1.GA\bin>rem @echo off

C:\Program Files\jboss-5.0.1.GA\bin>rem ----------------------------------------
---------------------------------

C:\Program Files\jboss-5.0.1.GA\bin>rem JBoss Bootstrap Script for Windows

C:\Program Files\jboss-5.0.1.GA\bin>rem ----------------------------------------
---------------------------------

C:\Program Files\jboss-5.0.1.GA\bin>rem $Id: run.bat 63250 2007-05-30 13:22:21Z
dimitris@jboss.org $

C:\Program Files\jboss-5.0.1.GA\bin>set JAVA_HOME="C:\jdk1.7.0"

C:\Program Files\jboss-5.0.1.GA\bin>if "Windows_NT" == "Windows_NT" (set "DIRNAM
E=C:\Program Files\jboss-5.0.1.GA\bin\" ) else (set DIRNAME=.\ )

C:\Program Files\jboss-5.0.1.GA\bin>pushd C:\Program Files\jboss-5.0.1.GA\bin\..


C:\Program Files\jboss-5.0.1.GA>if "x" == "x" (set "JBOSS_HOME=C:\Program Files\
jboss-5.0.1.GA" )

C:\Program Files\jboss-5.0.1.GA>popd

C:\Program Files\jboss-5.0.1.GA\bin>set DIRNAME=

C:\Program Files\jboss-5.0.1.GA\bin>if "Windows_NT" == "Windows_NT" (set "PROGNA
ME=run.bat" ) else (set "PROGNAME=run.bat" )

C:\Program Files\jboss-5.0.1.GA\bin>if "x" == "x" (set "JAVA_OPTS=-Dprogram.name
=run.bat" ) else (set "JAVA_OPTS= -Dprogram.name=run.bat" )

C:\Program Files\jboss-5.0.1.GA\bin>if "x"C:\jdk1.7.0"" == "x" (
set JAVA=java
echo JAVA_HOME is not set. Unexpected results may occur.
echo Set JAVA_HOME to the directory of your local JDK to avoid this message.
) else (
set "JAVA="C:\jdk1.7.0"\bin\java"
if exist ""C:\jdk1.7.0"\lib\tools.jar" (set "JAVAC_JAR="C:\jdk1.7.0"\lib\tools.
jar" )
)

C:\Program Files\jboss-5.0.1.GA\bin>rem Add -server to the JVM options, if suppo
rted

C:\Program Files\jboss-5.0.1.GA\bin>""C:\jdk1.7.0"\bin\java" -server -version
2>&1 | findstr /I hotspot 1>nul

C:\Program Files\jboss-5.0.1.GA\bin>if not errorlevel 1 (set "JAVA_OPTS=-Dprogra
m.name=run.bat -server" )

C:\Program Files\jboss-5.0.1.GA\bin>rem Set Java platform if 64-Bit JVM used

C:\Program Files\jboss-5.0.1.GA\bin>set JAVA_PLATFORM=

C:\Program Files\jboss-5.0.1.GA\bin>""C:\jdk1.7.0"\bin\java" -version 2>&1 |
findstr /I "64-Bit ^| x86_64" 1>nul

C:\Program Files\jboss-5.0.1.GA\bin>if not errorlevel 1 (if /I "x86" == "IA64" (
set JAVA_PLATFORM=ia64 ) else if /I "x86" == "AMD64" (set JAVA_PLATFORM=x64 )
else if /I "x86" == "x64" (set JAVA_PLATFORM=x64 ) else if /I "" == "IA64" (set
JAVA_PLATFORM=i64 ) else if /I "" == "AMD64" (set JAVA_PLATFORM=x64 ) else (
echo PROCESSOR_ARCHITECTURE is not set. Unexpected results may occur.
echo Set PROCESSOR_ARCHITECTURE according to the 64-Bit JVM used.
) )

C:\Program Files\jboss-5.0.1.GA\bin>if "x" == "x" set JAVA_PLATFORM=x86

C:\Program Files\jboss-5.0.1.GA\bin>rem Add native to the PATH if present

C:\Program Files\jboss-5.0.1.GA\bin>set JBOSS_NATIVE_LOC=

C:\Program Files\jboss-5.0.1.GA\bin>if exist "C:\Program Files\jboss-5.0.1.GA\bi
n\META-INF\lib\windows-x86" (set "JBOSS_NATIVE_HOME=C:\Program Files\jboss-5.0.1
.GA\bin\META-INF\lib\windows-x86" ) else if exist "C:\Program Files\jboss-5.0.1
.GA\bin\native" (set "JBOSS_NATIVE_HOME=C:\Program Files\jboss-5.0.1.GA\bin\nati
ve" )
\";C:\Program Files\jboss-5.0.1.GA\bin" was unexpected at this time.
C:\Program Files\jboss-5.0.1.GA\bin> set "PATH=;C:\WINDOWS\system32;C:\WINDOWS;
C:\WINDOWS\System32\Wbem;c:\Program Files\Microsoft SQL Server\90\Tools\binn\;"C
:\Program Files\Debugging Tools for Windows (x86)\";C:\Program Files\jboss-5.0.1
.GA\bin"
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do not install JBoss AS in Program Files!!! Spaces in the path will confuse run.bat and various Java libraries.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I've been getting this problem even after moving everything to c:\java.
problem seems to be caused around line 91 in run.bat - where your system level PATH is referenced.

Now, my %PATH% contains loads of useful windows tools all sensibly installed under "Program Files" and using " around each entry - which breaks line 91 of run.bat.
I sure ain't gonna change around everything else installed on my windows system just to get one server to run.
In my case, none of this non-java stuff needs to be passed to -Djava.library.path so I just took all references to %PATH% out:



Looks like this reference to your path was added as a result of this issue:
https://jira.jboss.org/jira/browse/JBAS-4418

I'd argue that you really don't want to be throwing your whole runpath at java just to make Oracle OCI drivers work - you end up with a situation where non-java & jboss related configuration changes (ie installing another program that touches your PATH) could suddenly break your installed jboss instance.

A couple of possible suggestions:
- have a JBOSS_PATH environment variable?
- rework this section of run.bat so it doesn't die if users quite reasonably have spaces and " characters in their %PATH%



 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Now, my %PATH% contains loads of useful windows tools all sensibly installed under "Program Files" and using " around each entry


I also have a dozen or so "Program Files" and "Program Files (x86)" entries in my PATH, but there are no quotes anywhere - they are not needed within PATH.

Actually, if you don't have JBoss Native installed, you can just as easily comment out the lines you posted. And if you have JBoss Native installed you can still comment out those lines and simply add the JBoss Nartive home directory to PATH so that the Native DLLs can be located. (The setting of java.library.path is not strictly required - it defaults to PATH anyway.)
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hai i am prince madurai. i am also face the same problem but finally i find out the solution.

JAVA_HOME=C:\Program Files\Java\jdk1.6.0
JBOSS_HOME=C:\jboss-4.2.3.GA
M2_HOME=D:\apache-maven-2.2.1
PATH=%path%;%JAVA_HOME%\bin;%JBOSS_HOME%\bin;%M2_HOME%\bin

please try it.
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Prince, welcome to Java Ranch!

A few comments:

a) Avoid installing the JDK or any Java software in paths with space. Yes, the Sun JDK installes into Program Files by default, I always recommend changing that and installing at something like c:\apps\jdj1.6.0_22

b) Never set JBOSS_HOME. The run.bat script will set it based on its location. If you set JBOSS_HOME then you can run into surprises if you either move JBoss AS or if you install another version in another location.
reply
    Bookmark Topic Watch Topic
  • New Topic