Can't get openhab2.1.0 to open in windows 7

When I click the .bat file and run as administrator it flashes then doesn’t start. I have let it sit for 20 minutes. Help please!!!

Hi Kevin,
The flash you seeing is presumably the command window coming up and then immediately exiting for some reason.
Start.bat runs the batch file runtime\bin\karaf.bat
you might be able to see what the problem is by putting a “pause” at the end of the karaf.bat so that any output messages stay on the screen.

How do I pause? I’m extremely new to this type of programming. I am a plc integrator and programmer that is trying to learn something else. Any help would be appreciated.

edit karaf.bat in Windows Notepad. Add a blank line at the very end of the file and then on the next line type the single word “pause” (without quotes) and then add another blank line.
When you run start.bat instead of karaf.bat immediately exiting it will stop, it will type out a prompt (usually something like “hit any key to continue”) and you can scroll back through the output to see if it’s complaining about something.
Do you have any experience with batch file programming under Windows?

No…none at all

Are you using the cmd.exe to run the .bat file


What folder did you put the program in? I’m pretty new to this and all, but it seems like it needs to be named “openhab-2.2.0” (which is the original name of the ZIP you downloaded).

Original zip was openhab-2.1.0…I put it in c: drive

@rekoj did you install on windows 7,8, 10…I have 7 home premium…I can upgrade to windows 10 if it works better but I prefer 7

you should be able to run start.bat by double-clicking on it in the Windows file Explorer. if you use cmd.exe you have to rename the file to something else, for example startoph.bat . Otherwise the Windows command shell thinks that you are using its internal “start” command .
I’m running on Windows 7 professional. Works fine.
I’m pretty sure that you can put your program into any folder.

Please read this:

Most important on above site: (Link)

"Add the JAVA_HOME System Environment Variable in Windows.

Navigate to:

Control Panel :arrow_right: System and Security :arrow_right: System :arrow_right: Advanced System Settings :arrow_right: Environment Variables :arrow_right: System Variables
Create a New System Variable based on your Java installation directory:

The directory that openHAB is installed to must contain no spaces. On this page, we will be using C:\openHAB2 as an example."

I forgot about the requirement that the directory must have no spaces.

I am having the same problem with this. been on it for hours and still cant get anywhere.

Hi Michael, welcome to the community!

From you’re one liner it’s difficult to tell what is wrong, so I’m going to play captain obvious here and ask some obvious questions.

My gut feeling tells me that the system can’t find Java which is required for openHAB to run so let’s start there.

Did you follow the installation instruction? Especially the part about installing Java 8?

When you open a command prompt and type java -version what output does this command give?

When you open a command prompt and type echo %JAVA_HOME% what output does this command give?

I’m currently running 8.8.221

Are you sure that the JAVA_HOME variable is set correctly. By default Java would install to C:\Program Files\... (note the space between Program and Files). In your case the JAVA_HOME variable points to C:\ProgramFiles\.... This is of course possible if you deliberately installed it to that location.

If you start the start.bat file from openHAB from the command prompt, does the script print out any errors?

when i run the start.bat file from the command prompt, i get this message

The file name is the same as whats in the directory

Ok, it seems that you have now configured the JAVA_HOME variable as C:\Program Files\Java\jre1.8.0_121. However, your Java is installed in C:\Program Files\Java\jre1.8.0_221.
I missed this when you posted your first screenshot (121 vs 221 ).

Please update your JAVA_HOME variable to C:\Program Files\Java\jre1.8.0_221

After updating the variable you need to open a new command prompt to activate the change and then please run the start.bat file again.

It seems that you have installed both:

JRE = Java Runtime Environment (jre1.8.0_221)


JDK = Java Development Kit (jdk1.8.0_121)

Your JAVA_HOME variable first pointed to your JDK installation. (Post 15). Maybe you did uninstall JDK later?.

Then it seems you have changed your JAVA_HOME variable to the wrong JRE installation path. (Post 17).

If so, change your JAVA_HOME variable to your JRE installation path.

See also above, post no. 11 : (Post 11).