allelopath
asked on
Windows cannot find '.\jre\bin\javaw'
I run a batch file and get the error " Windows cannot find '.\jre\bin\javaw' "
The directory/file structure is:
[MyDirectory]
[jre]
[bin]
javaw.exe
my.bat
(ie my.bat is in MyDirectory, same level as [jre])
Where my.bat is:
start .\jre\bin\javaw -Xmx1024M <more stuff>
I've set the PATH and CLASSPATH to include C:\...\MyDirectory\jre\bin
JAVA_HOME is C:\Program Files\Java\jdk1.6.0_18. This is the 'main' java so to speak. I want to run a particular jre with this batch file.
What do I need to do?
The directory/file structure is:
[MyDirectory]
[jre]
[bin]
javaw.exe
my.bat
(ie my.bat is in MyDirectory, same level as [jre])
Where my.bat is:
start .\jre\bin\javaw -Xmx1024M <more stuff>
I've set the PATH and CLASSPATH to include C:\...\MyDirectory\jre\bin
JAVA_HOME is C:\Program Files\Java\jdk1.6.0_18. This is the 'main' java so to speak. I want to run a particular jre with this batch file.
What do I need to do?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Doh! I was off on that.
What about removing the "start" or specifiying the 'path' option for the directory to start in.
What about removing the "start" or specifiying the 'path' option for the directory to start in.
ASKER
Can this work by explicitly defining the path without setting any environment variables?
My suggestion doesn't involve setting any
start .\jre\bin\javaw -Xmx1024M /D"<complete_path>\jre\bin \"
Actually:
start javaw -Xmx1024M /D"<complete_path>\jre\bin \"
start javaw -Xmx1024M /D"<complete_path>\jre\bin
ASKER
>>My suggestion doesn't involve setting any
It does require JAVA_HOME
It does require JAVA_HOME
ASKER
My problem appears to be that .\jre\bin goes one directory up.
If I move the bat file like so:
[MyDirectory]
[jre]
[bin]
javaw.exe
[anotherDir]
my.bat
It works.
So i don't understand the .\
I thought . said "start where I am"
If I move the bat file like so:
[MyDirectory]
[jre]
[bin]
javaw.exe
[anotherDir]
my.bat
It works.
So i don't understand the .\
I thought . said "start where I am"
>>It does require JAVA_HOME
That would simply be a parameter
You should keep your batch files out of the Java tree altogether btw
That would simply be a parameter
You should keep your batch files out of the Java tree altogether btw
What is the motivation of the batch file btw? Why, for instance are you not running an executable jar?
ASKER
>>What is the motivation of the batch file btw?
Just does some other stuff.
Just does some other stuff.
ASKER
no, I said my.bat is in MyDirectory, same level as [jre].
jre is in MyDirectory