But while starting JBoss as windows service i got an error message that JAVA_HOME is not set.
Please post the entire error message that you see. Where do you see this error message? Try setting the JAVA_HOME in the run.bat and see if it works. Here's a small portion from the run.bat, in which i am setting the JAVA_HOME:
When setting JAVA_HOME, make sure you set it in the "System variables" and not in "User variables for xxx". If you run the JBossAS service as the SYSTEM account, or under its own account, it will prick up the "System variables' but not the user variables for your account.