13 Replies Latest reply on Jul 26, 2008 2:08 AM by gan.gary

    JAVA_HOME is not set.  Unexpected results may occur.? JBoss

    gan.gary

      When I install JBoss as windows service, it works fine, but after several test on VPC, I hit this error:

      Starting JBoss Application Server 5.0 [2008-07-24 04:18:06]
      ECHO is off.
      JAVA_HOME is not set. Unexpected results may occur.
      Set JAVA_HOME to the directory of your local JDK to avoid this message.
      ===============================================================================

      JBoss Bootstrap Environment

      JBOSS_HOME: C:\jboss-4.2.2.GA

      JAVA: java

      JAVA_OPTS: -Xrs -Dprogram.name=run.bat -server -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000

      CLASSPATH: C:\jboss-4.2.2.GA\bin\run.jar

      ===============================================================================

      Error: no `server' JVM at `C:\Program Files\Java\jre1.5.0_15\bin\server\jvm.dll'.
      Shutdown JBoss Application Server 5.0 service [2008-07-24 04:18:07]


      I found this post but nobody answered http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3987689#3987689. anyone?

        • 1. Re: JAVA_HOME is not set.  Unexpected results may occur.? JB
          subemontes

          Well, I think, but I'm not sure, that Server dll and Server Java are only included in SDK installs.

          Maybe that's the problem ?

          Btw, edit the .bat and put an
          echo JAVA_HOME: %JAVA_JOME%
          echo JRE_HOME: %JRE_HOME% (or something like that)

          • 2. Re: JAVA_HOME is not set.  Unexpected results may occur.? JB
            subemontes

            In addiction, that JAVA: java is a bad sign.

            It must point to JRE or JDK install folder.

            I recomend JDK cos the utilities. and in Servers productions u can no to installa JAVA jre (per examle)

            • 3. Re: JAVA_HOME is not set.  Unexpected results may occur.? JB
              peterj

              When running JBossAS as a service in Windows, you must make sure that you set JAVA_HOME in the System Variables section of the Environment Variables tab on the system properties dialog. Setting JAVA_HOME in the User Variables section will not work!

              • 4. Re: JAVA_HOME is not set.  Unexpected results may occur.? JB
                peterj

                Alternately, if you are using JBoss Native to run the service, you can change service.bat to set JAVA_HOME.

                • 5. Re: JAVA_HOME is not set.  Unexpected results may occur.? JB
                  gan.gary

                   

                  When running JBossAS as a service in Windows, you must make sure that you set JAVA_HOME in the System Variables section of the Environment Variables tab on the system properties dialog. Setting JAVA_HOME in the User Variables section will not work!


                  No, I set it at system environment variable (the bottom one). It runs fine when using run.bat. It only not work on this VPC environment. Previously all ok.

                  "PeterJ" wrote:
                  Alternately, if you are using JBoss Native to run the service, you can change service.bat to set JAVA_HOME.


                  you meant I can set :

                  %JAVA_HOME% = C:\Program Files\Java\jdk1.5.0_15


                  in the run.bat?



                  • 6. Re: JAVA_HOME is not set.  Unexpected results may occur.? JB
                    gan.gary

                     

                    "Subemontes" wrote:
                    Well, I think, but I'm not sure, that Server dll and Server Java are only included in SDK installs.

                    Maybe that's the problem ?

                    Btw, edit the .bat and put an
                    echo JAVA_HOME: %JAVA_JOME%
                    echo JRE_HOME: %JRE_HOME% (or something like that)

                    I put this in run.bat:

                    :FOUND_RUN_JAR
                    
                    echo JAVA_HOME0 %JAVA_HOME%
                    if not "%JAVA_HOME%" == "" goto ADD_TOOLS
                    
                    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.
                    goto SKIP_TOOLS
                    
                    :ADD_TOOLS
                    
                    
                    set JAVA=%JAVA_HOME%\bin\java
                    
                    echo JAVA_HOME1 %JAVA_HOME%

                    I get this in normal mode:

                    JAVA_HOME0 C:\Program Files\Java\jdk1.5.0_15
                    JAVA_HOME1 C:\Program Files\Java\jdk1.5.0_15


                    but I get:
                    Starting JBoss Application Server 5.0 [2008-07-24 17:29:14]
                    JAVA_HOME0
                    JAVA_HOME is not set. Unexpected results may occur.
                    Set JAVA_HOME to the directory of your local JDK to avoid this message.

                    when run as windows service mode


                    It must point to JRE or JDK install folder.

                    I recomend JDK cos the utilities. and in Servers productions u can no to installa JAVA jre (per examle)

                    I do not get what you meant. Cna explain?

                    • 7. Re: JAVA_HOME is not set.  Unexpected results may occur.? JB
                      gan.gary

                      What the hell, I re-started my PC and everything works fine. I suspect the %JAVA_HOME% has not taken effect yet, thought I open another command shell.I think I need to report to JBoss bugzilla.

                      • 8. Re: JAVA_HOME is not set.  Unexpected results may occur.? JB
                        jaikiran

                         

                        No, I set it at system environment variable (the bottom one).

                        %JAVA_HOME% = C:\Program Files\Java\jdk1.5.0_15


                        Is this exactly how you set the JAVA_HOME? Then it is incorrect. There should be no % while setting the value.




                        • 9. Re: JAVA_HOME is not set.  Unexpected results may occur.? JB
                          gan.gary

                           

                          "jaikiran" wrote:
                          No, I set it at system environment variable (the bottom one).

                          %JAVA_HOME% = C:\Program Files\Java\jdk1.5.0_15


                          Is this exactly how you set the JAVA_HOME? Then it is incorrect. There should be no % while setting the value.


                          No, that's typo. I have reported it to JBoss BugZilla: https://jira.jboss.org/jira/browse/JBNATIVE-61 :) Hope what I found is a bug in Jboss Native.

                          • 10. Re: JAVA_HOME is not set.  Unexpected results may occur.? JB
                            gan.gary

                             

                            "jaikiran" wrote:
                            No, I set it at system environment variable (the bottom one).
                            %JAVA_HOME% = C:\Program Files\Java\jdk1.5.0_15

                            Is this exactly how you set the JAVA_HOME? Then it is incorrect. There should be no % while setting the value.


                            that's on run.bat. Peterj mentioned can set explicitly at "run.bat":

                            Alternately, if you are using JBoss Native to run the service, you can change service.bat to set JAVA_HOME.


                            • 11. Re: JAVA_HOME is not set.  Unexpected results may occur.? JB
                              peterj

                              The fact that new system properties are not found by the services until after you reboot the PC is not a JBoss Native bug - it is the operating system, and specifically the service manager, that is not registering the env var changes until a reboot. Therefore you should not have opened a JIRA. There is nothing that the JBoss team can do to fix this.

                              • 12. Re: JAVA_HOME is not set.  Unexpected results may occur.? JB
                                peterj

                                Also, I did mean service.bat. It is part of JBoss Native. You still have not said how you go about running as a service, if you use JBoss Native or some other tool to do that.

                                It is better to change service.bat that run.bat because you might at some later time run run.bat manually and then wonder why it is not picking up the JAVA_HOME setting that you made on the command line.

                                • 13. Re: JAVA_HOME is not set.  Unexpected results may occur.? JB
                                  gan.gary

                                   

                                  "PeterJ" wrote:
                                  The fact that new system properties are not found by the services until after you reboot the PC is not a JBoss Native bug - it is the operating system, and specifically the service manager, that is not registering the env var changes until a reboot. Therefore you should not have opened a JIRA. There is nothing that the JBoss team can do to fix this.


                                  thanks for your explaination. I closed it. At least I can update the Jboos Wiki, it might be helpful for others.

                                  Also, I did mean service.bat.

                                  I meant it too. sorry, that's my typo previously to answer jakiran.