Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JAVA_HOME variable is not working properly in bat file  RSS feed

 
Kaarthick Ramamoorthy
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have installed two versions of java in my machine, say c:\jdk1.5 and
c:\program files\jdk1.4.


I would like to invoke appropriate java interpreter by setting
JAVA_HOME variable. For that I have written a batch file, but it
doesn't work correctly.



A is the Java class file.

If I set JAVA_HOME=c:\jdk1.5, the above code works fine.
If I set JAVA_HOME=c:\program files\jdk1.4, produces error.

I think the problem is the space between program and files.
Help me to resolve this problem.

Thanks in advance,
Kaarthick.R
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16026
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, that's because there is a space in the path to your JDK 1.4 (C:\Program<space>Files\jdk1.4). Try adding quotes:

[ February 02, 2007: Message edited by: Jesper Young ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!