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
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.
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
Joined: Nov 13, 2009
Posts: 10
posted
0
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
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
Joined: Nov 13, 2009
Posts: 10
posted
0
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.
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
Joined: Nov 13, 2009
Posts: 10
posted
0
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>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
Do not install JBoss AS in Program Files!!! Spaces in the path will confuse run.bat and various Java libraries.
Brendan Richards
Greenhorn
Joined: Jun 01, 2005
Posts: 3
posted
0
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:
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%
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.)
prince vijayakumar
Greenhorn
Joined: Apr 30, 2008
Posts: 1
posted
0
hai i am prince madurai. i am also face the same problem but finally i find out the solution.
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.