If there is always just one AS server started then you may change the JBOSS_HOME variable just before starting the AS. But you may decide to change the JAVA_HOME variable as well since JBoss 7 requires JRE 1.7.
If you want to have more than one AS started at the same time then you will also have to change the port numbers accordingly.
Thank you, for your answer.I want run one AS alone. I understand you idea, but exists any other way to solve it too? This solution I found too. I need a pernament solution without changing JBOSS_HOME before running AS.
I found any idea which will be may be working. But I am a beginner with using JBOSS,WildFly( I use the only few months). In folder JBOSS(Wildfly)\bin\ exists some *.bat files and in which there use JBOSS_HOME strings( for example: standalone.bat,standalone.conf.bat, .. ). In windows notepad I can change(replace) the JAVA_HOME in this files to any variable ( for example JBOSS7_HOME, WILDFLY8_HOME,.. ) and then I set the system variable corectly to correct folder way.
Have you idea which *.bat files must I change?
No, the environment variable must be named to JBOSS_HOME.
I am not sure understanding your problem. Usually this environment entry is set before starting the AS.
In MS/Windows this can be done via the control panel (user / system environment variables) or just via the set command.
Another option might be to add some other environment variables (JBOSS7_HOME, WILDFLY8_HOME etc) to the standalone.bat and copy them over to JBOSS_HOME before starting the AS. But I don't recommend this.You should not set this hard-coded in the standalone.bat.
I think the best solution would be to just remove/unset JBOSS_HOME environment variable, this way it wont clash with the version of sever you are trying to run.
by default if not set, scripts set it for single processes only to value of current folder from where you run the server.
I solve it so I do not use JBOSS_HOME in Windows. For now, it is look like it is working.