java - Running Eclipse from usb -
i have put necessary files on usb pen drive, java development kit , eclipse files. have created .bat file reads
@echo off set path=\32 bit\jdk32\bin;%path% cd "32 bit\eclipse" start eclipse.exe exit
however when run batch, eclipse launches , brings error
as far can tell trying use old path variable jni shared library. me problem please.
it turns out there simple solution this.
amended .bat file
@echo off set path=%~dp032 bit\jdk32\bin;%path% cd "32 bit\eclipse" start eclipse.exe exit
explanation
this works getting path of executing batch file using command %~dp0
.
where
- d drive (in case
n:\
) - p path (
code\java\eclipse mars\
) - 0 name of executing batch file
this path n:\code\java\eclipse mars\32 bit\jdk32\bin
sets java version correctly , removes error had above
Comments
Post a Comment