syvaidya / openstego

OpenStego is a steganography application that provides two functionalities: a) Data Hiding: It can hide any data within an image file. b) Watermarking: Watermarking image files with an invisible signature. It can be used to detect unauthorized file copying.
https://www.openstego.com
GNU General Public License v2.0
1.13k stars 206 forks source link

Problem with .bat file on windows #42

Closed Shivatack closed 2 years ago

Shivatack commented 2 years ago

Hello all,

I wanted to run Openstego and then ran into the JAVA_HOME is not set. So I went to set it up in env settings. After that, the message changed for JAVA_HOME is set to an invalid directory even if it was set to the good one.

So after investigating a bit I found out that a line is at the wrong place in the .bat file so I replaced this :

if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java
if "%1"=="" set JAVA_EXE=javaw

by this :

set JAVA_EXE=java

if defined JAVA_HOME goto findJavaFromJavaHome

if "%1"=="" set JAVA_EXE=javaw

and it worked. I think it's because, JAVA_HOME was defined and then the program was executing this line :

set JAVA_EXE=%JAVA_HOME%\bin\%JAVA_EXE%.exe

but as the JAVA_EXE was never set because it was placed after the "if defined" instruction, then this line was producing an error.

I think this should be fixed as shown. Sorry if my english is not accurate, not my native language tho.

syvaidya commented 2 years ago

Thanks @Shivatack for the report. You are right. I've fixed the batch file now. I'll release new version shortly.