How to change JAVA_HOME in Eclipse on Windows.

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

How to change JAVA_HOME in Eclipse on Windows.

Jan Ehrhardt
Hi,

I don't understand why on Linux and Mac OS X Eclipse has no problems with JAVA_HOME, but on Windows, JAVA_HOME points to the JRE instead of JDK.
I tried to change this, but everything I tried failed. So what's exaclly the way to change JAVA_HOME (what preference is the right one)?

Thanks
Jan

PS: Another stupid behavior is, that I created a laucher in Eclipse for running grails.bat manually. If I give it the parameter run-app, it starts without any trouble, but it doesn't stop correctlly. If I try to start the app again, the address is still in use and I need to kill java.exe manually in the Task Manager. I've got this behavior only on Windows ... hhmmmmppppfff
Reply | Threaded
Open this post in threaded view
|

Re: How to change JAVA_HOME in Eclipse on Windows.

burtbeckwith
Go to Window|Preferences|Java|Installed JREs and you can point the JRE/JDK
from the auto-discovered JRE to the real JDK.

Burt

On Monday 16 June 2008 2:13:05 pm Jan Ehrhardt wrote:

> Hi,
>
> I don't understand why on Linux and Mac OS X Eclipse has no problems with
> JAVA_HOME, but on Windows, JAVA_HOME points to the JRE instead of JDK.
> I tried to change this, but everything I tried failed. So what's exaclly
> the way to change JAVA_HOME (what preference is the right one)?
>
> Thanks
> Jan
>
> PS: Another stupid behavior is, that I created a laucher in Eclipse for
> running grails.bat manually. If I give it the parameter run-app, it starts
> without any trouble, but it doesn't stop correctlly. If I try to start the
> app again, the address is still in use and I need to kill java.exe manually
> in the Task Manager. I've got this behavior only on Windows ...
> hhmmmmppppfff



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

RE: How to change JAVA_HOME in Eclipse on Windows.

Hayram Nicacio-2
In reply to this post by Jan Ehrhardt
 
I use to joke with my co-workers that the right way to solve this on x86 plattform is installing Linux. But I don´t want to start a flame war.
 
In Windows XP, right click My Computer, select Properties (System Properties shows up). Alternative way: Control Panel, double click System.
 
Select Advanced folder on System Properties. Click Environment Variables button. Edit JAVA_HOME.
 
Don´t forget:
1. Do not leave spaces in the path (JAVA_HOME, GROOVY_HOME, GRAILS_HOME). Use "c:\progra~1" instead of "c:\program files".
2. Delete CLASSPATH environment variable.
3. Consider using IntelliJ. Just for the record, I like Eclipse and use it for PHP and C/C++ too. But IntelliJ is better for Java based projects.
 
Good Luck.

Hayram Nicacio
Software Developer
Ingenico Latin America
BRAZIL
Phone: +55(11) 3178-0003

-----Original Message-----
From: Jan Ehrhardt [mailto:[hidden email]]
Sent: segunda-feira, 16 de junho de 2008 15:13
To: [hidden email]
Subject: [grails-user] How to change JAVA_HOME in Eclipse on Windows.

Hi,

I don't understand why on Linux and Mac OS X Eclipse has no problems with JAVA_HOME, but on Windows, JAVA_HOME points to the JRE instead of JDK.
I tried to change this, but everything I tried failed. So what's exaclly the way to change JAVA_HOME (what preference is the right one)?

Thanks
Jan

PS: Another stupid behavior is, that I created a laucher in Eclipse for running grails.bat manually. If I give it the parameter run-app, it starts without any trouble, but it doesn't stop correctlly. If I try to start the app again, the address is still in use and I need to kill java.exe manually in the Task Manager. I've got this behavior only on Windows ... hhmmmmppppfff
 
About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them.
www.ingenico.com

This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation.

Reply | Threaded
Open this post in threaded view
|

Re: How to change JAVA_HOME in Eclipse on Windows.

Jan Ehrhardt
In reply to this post by burtbeckwith
Hi Burt,

that's exactlly what I did. My default "Installed JRE" points to "E:\Programme\Java\jdk1.5.0_15". But running the app brings the result:

Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "E:\Programme\Java\jdk1.5.0_15\jre"

So, why does Eclipse ignore, that it shouldn't use the jre sub directory?

Thanks,
Jan

On Mon, Jun 16, 2008 at 8:20 PM, Burt Beckwith <[hidden email]> wrote:
Go to Window|Preferences|Java|Installed JREs and you can point the JRE/JDK
from the auto-discovered JRE to the real JDK.

Burt

On Monday 16 June 2008 2:13:05 pm Jan Ehrhardt wrote:
> Hi,
>
> I don't understand why on Linux and Mac OS X Eclipse has no problems with
> JAVA_HOME, but on Windows, JAVA_HOME points to the JRE instead of JDK.
> I tried to change this, but everything I tried failed. So what's exaclly
> the way to change JAVA_HOME (what preference is the right one)?
>
> Thanks
> Jan
>
> PS: Another stupid behavior is, that I created a laucher in Eclipse for
> running grails.bat manually. If I give it the parameter run-app, it starts
> without any trouble, but it doesn't stop correctlly. If I try to start the
> app again, the address is still in use and I need to kill java.exe manually
> in the Task Manager. I've got this behavior only on Windows ...
> hhmmmmppppfff



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: How to change JAVA_HOME in Eclipse on Windows.

Jan Ehrhardt
In reply to this post by Hayram Nicacio-2
Hi,

I think you're right with the Linux hint, but sometimes I don't have the choice. I would prefer to work on a Mac (x86 too), but I'm forced to use Windows so far :-(

I tried the steps you rcommented, but it didn't help.

The problem with IDEA is, that I didn't try it so far, because it's maybe good and maybe I'll love it, but at work there is no place for IDEA. So it's better to leave my hands off, until I'm working in a company with IDEA ;-)

Thanks
Jan

On Mon, Jun 16, 2008 at 8:36 PM, Hayram Nicacio <[hidden email]> wrote:
 
I use to joke with my co-workers that the right way to solve this on x86 plattform is installing Linux. But I don´t want to start a flame war.
 
In Windows XP, right click My Computer, select Properties (System Properties shows up). Alternative way: Control Panel, double click System.
 
Select Advanced folder on System Properties. Click Environment Variables button. Edit JAVA_HOME.
 
Don´t forget:
1. Do not leave spaces in the path (JAVA_HOME, GROOVY_HOME, GRAILS_HOME). Use "c:\progra~1" instead of "c:\program files".
2. Delete CLASSPATH environment variable.
3. Consider using IntelliJ. Just for the record, I like Eclipse and use it for PHP and C/C++ too. But IntelliJ is better for Java based projects.
 
Good Luck.

Hayram Nicacio
Software Developer
Ingenico Latin America
BRAZIL
Phone: +55(11) 3178-0003

-----Original Message-----
From: Jan Ehrhardt [mailto:[hidden email]]
Sent: segunda-feira, 16 de junho de 2008 15:13
To: [hidden email]
Subject: [grails-user] How to change JAVA_HOME in Eclipse on Windows.

Hi,

I don't understand why on Linux and Mac OS X Eclipse has no problems with JAVA_HOME, but on Windows, JAVA_HOME points to the JRE instead of JDK.
I tried to change this, but everything I tried failed. So what's exaclly the way to change JAVA_HOME (what preference is the right one)?

Thanks
Jan

PS: Another stupid behavior is, that I created a laucher in Eclipse for running grails.bat manually. If I give it the parameter run-app, it starts without any trouble, but it doesn't stop correctlly. If I try to start the app again, the address is still in use and I need to kill java.exe manually in the Task Manager. I've got this behavior only on Windows ... hhmmmmppppfff
 
About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them.
www.ingenico.com

This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation.


Reply | Threaded
Open this post in threaded view
|

RE: How to change JAVA_HOME in Eclipse on Windows (missing Eclipse specific).

Hayram Nicacio-2
In reply to this post by Hayram Nicacio-2
I forgot to tell the Eclipse specific:
 
Window -> Preferences -> Java -> Build Path -> Classpath Variables.
 
Good luck again.

Hayram Nicacio
Software Developer
Ingenico Latin America
BRAZIL
Phone: +55(11) 3178-0003

-----Original Message-----
From: Hayram Nicacio [mailto:[hidden email]]
Sent: segunda-feira, 16 de junho de 2008 15:37
To: [hidden email]
Subject: RE: [grails-user] How to change JAVA_HOME in Eclipse on Windows.

 
I use to joke with my co-workers that the right way to solve this on x86 plattform is installing Linux. But I don´t want to start a flame war.
 
In Windows XP, right click My Computer, select Properties (System Properties shows up). Alternative way: Control Panel, double click System.
 
Select Advanced folder on System Properties. Click Environment Variables button. Edit JAVA_HOME.
 
Don´t forget:
1. Do not leave spaces in the path (JAVA_HOME, GROOVY_HOME, GRAILS_HOME). Use "c:\progra~1" instead of "c:\program files".
2. Delete CLASSPATH environment variable.
3. Consider using IntelliJ. Just for the record, I like Eclipse and use it for PHP and C/C++ too. But IntelliJ is better for Java based projects.
 
Good Luck.

Hayram Nicacio
Software Developer
Ingenico Latin America
BRAZIL
Phone: +55(11) 3178-0003

-----Original Message-----
From: Jan Ehrhardt [mailto:[hidden email]]
Sent: segunda-feira, 16 de junho de 2008 15:13
To: [hidden email]
Subject: [grails-user] How to change JAVA_HOME in Eclipse on Windows.

Hi,

I don't understand why on Linux and Mac OS X Eclipse has no problems with JAVA_HOME, but on Windows, JAVA_HOME points to the JRE instead of JDK.
I tried to change this, but everything I tried failed. So what's exaclly the way to change JAVA_HOME (what preference is the right one)?

Thanks
Jan

PS: Another stupid behavior is, that I created a laucher in Eclipse for running grails.bat manually. If I give it the parameter run-app, it starts without any trouble, but it doesn't stop correctlly. If I try to start the app again, the address is still in use and I need to kill java.exe manually in the Task Manager. I've got this behavior only on Windows ... hhmmmmppppfff
 
About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them.
www.ingenico.com

This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation.

 
About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them.
www.ingenico.com

This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation.

Reply | Threaded
Open this post in threaded view
|

Re: How to change JAVA_HOME in Eclipse on Windows.

Jan Ehrhardt
In reply to this post by Hayram Nicacio-2
Well,

I just thought the Linux hint were good. I've just set up a fresh Eclipse of the current stable version on Linux and I got the same stupid problem.
I even tried to override the JAVA_HOME variable in the launch configuration, but it didn't work :-(

The only comfort is, that I can run Grails es an external app.

Jan

On Mon, Jun 16, 2008 at 8:36 PM, Hayram Nicacio <[hidden email]> wrote:
 
I use to joke with my co-workers that the right way to solve this on x86 plattform is installing Linux. But I don´t want to start a flame war.
 
In Windows XP, right click My Computer, select Properties (System Properties shows up). Alternative way: Control Panel, double click System.
 
Select Advanced folder on System Properties. Click Environment Variables button. Edit JAVA_HOME.
 
Don´t forget:
1. Do not leave spaces in the path (JAVA_HOME, GROOVY_HOME, GRAILS_HOME). Use "c:\progra~1" instead of "c:\program files".
2. Delete CLASSPATH environment variable.
3. Consider using IntelliJ. Just for the record, I like Eclipse and use it for PHP and C/C++ too. But IntelliJ is better for Java based projects.
 
Good Luck.

Hayram Nicacio
Software Developer
Ingenico Latin America
BRAZIL
Phone: +55(11) 3178-0003

-----Original Message-----
From: Jan Ehrhardt [mailto:[hidden email]]
Sent: segunda-feira, 16 de junho de 2008 15:13
To: [hidden email]
Subject: [grails-user] How to change JAVA_HOME in Eclipse on Windows.

Hi,

I don't understand why on Linux and Mac OS X Eclipse has no problems with JAVA_HOME, but on Windows, JAVA_HOME points to the JRE instead of JDK.
I tried to change this, but everything I tried failed. So what's exaclly the way to change JAVA_HOME (what preference is the right one)?

Thanks
Jan

PS: Another stupid behavior is, that I created a laucher in Eclipse for running grails.bat manually. If I give it the parameter run-app, it starts without any trouble, but it doesn't stop correctlly. If I try to start the app again, the address is still in use and I need to kill java.exe manually in the Task Manager. I've got this behavior only on Windows ... hhmmmmppppfff
 
About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them.
www.ingenico.com

This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation.


Reply | Threaded
Open this post in threaded view
|

Re: How to change JAVA_HOME in Eclipse on Windows.

Martijn Stalenhoef
Have you tried the eclipse -vm parameter? It forces eclipse itself to
use a specific VM.
You can also set it in the eclipse.ini file, like so:

-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
-vm
E:\Programme\Java\jdk1.5.0_15\bin\javaw.exe
-vmargs
-Xms40m
-Xmx256m

Before you ask:it's not a standard windows .ini file. The name and the
value of the parameters are on different lines.

Martijn

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: How to change JAVA_HOME in Eclipse on Windows.

Martijn Stalenhoef
OK, I just had the same kind of experience: I switched my default
runtime to JDK 1.6 and now JAVA_HOME seems to be set to <path to
JDK>/jre and Grails started to complain about that.
Solved it by adding tools.jar (from <path to JDK>/lib) the the JRE classpath.

Martijn

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: How to change JAVA_HOME in Eclipse on Windows.

Jan Ehrhardt
Wow,

this definitivly solved the problem on Linux. Currently I didn't try it on Windows.
Maybe, it can be added to the IDE integration part of the Grails documentation.

Thanks
Jan

On Thu, Jun 19, 2008 at 3:51 PM, Martijn Stalenhoef <[hidden email]> wrote:
OK, I just had the same kind of experience: I switched my default
runtime to JDK 1.6 and now JAVA_HOME seems to be set to <path to
JDK>/jre and Grails started to complain about that.
Solved it by adding tools.jar (from <path to JDK>/lib) the the JRE classpath.

Martijn

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email