One way to access% ProgramFiles (x86)% in Vista 32 bit and Win 7 64 bit

I am developing a Java application and deploying it using a batch file. At work, I use Vista 32 bit, and at home I use win 7 64 bit. The batch file calls java.exe to perform some tasks.

Due to some kind of problem with Netbeans, I have to do my development in 32-bit Java (both at home and at work), so at home I have a 32-bit jdk installed in% ProgramFiles (x86)%, on which I do my development, as well as 64 bit in% ProgramFiles% (which is used for other things)

Is there any single way to access the 32-bit folder on work and home computers, so I don’t need to have two copies of the batch files (the home one calling java.exe in% ProgramFiles (x86)% and the office calling default java. exe (in% ProgramFiles%)

+3
source share
2 answers

We are doing something like this:

set programfiles32=%programfiles(x86)%
if "%programfiles32%"=="" set programfiles32=%programfiles%

copy foo.dll "%programfiles32%"
+3
source

This may surprise you, but when you do it java.exeor javaw.exewithout specifying a path, it does a copy in C:\Windows\system32. These copies are actually redirectors that read registry keys to determine the latest version of Java. However, you can override it using an environment variable JAVA_HOME.

Windows " ", "", "", " "... , , , XP. , Win7.

: , JAVA_HOME JVM/JDK. 32- XP C:\Program Files\Java\jdk1.6.0_24, JDK.

+2

All Articles