2

I have a situation in which I have to work on a project with Java 1.7 on Windows 7. But, there is a tool jwsdp-1_6-windows-i586.exe which is seraching for Java 1.5 or less to be installed and to work with.

Now, I am in a dilemma of whether to point my JAVA_HOME to 1.7 or 1.5. Or am I worrying about it without purpose? How to overcome the issue? Is there any possibility that we can provide JAVA_HOME with multiple locations?

Cadoiz
  • 1,446
  • 21
  • 31
Gurminder Singh
  • 1,755
  • 16
  • 19
  • You cannot provide more than one location, but you can provide different JAVA_HOME to different programs. – Thilo Sep 23 '13 at 06:58
  • how can we achieve it? I mean for **different programs**? Can you elaborate a bit more? – Gurminder Singh Sep 23 '13 at 07:02
  • You can consider [this related Q/A](https://stackoverflow.com/questions/37180393/why-tomcat8-exe-starts-with-a-java-home-that-is-different-from-java-home-setted?rq=1) – Cadoiz Sep 29 '21 at 10:23

1 Answers1

2

Create a batch file that starts jwsdp-1_6-windows-i586.exe:

set JAVA_HOME=...path-to-Java-5...
jwsdp-1_6-windows-i586.exe

Always invoke the command using the batch file.

If you don't have control over the invocation, here is a trick: Rename the executable and put your batch file in the path as jwsdp-1_6-windows-i586.cmd. When the invoker uses jwsdp-1_6-windows-i586 to execute the command, then this trick will make it use the batch file instead.

Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820