Skip to main content



      Home
Home » Newcomers » Newcomers » Eclipse selects wrong JRE
Eclipse selects wrong JRE [message #200893] Wed, 21 March 2007 11:58 Go to next message
Eclipse UserFriend
Originally posted by: fake.phony_email_address.com

I have three JREs installed into Eclipse. When I run a class, Eclipse
always selects 1.4.2, even though I have set the default JRE to 1.5 or
1.6 in Window/Preferences/Installed JREs.

All options under Execution Environments are unchecked. Checking them
does not change this behavior.

Under the Run... configuration for my executable class, the JRE table
has "Project JRE 1.4.2" selected. If I change to an alternative JRE,
then things work correctly. The trouble is that I never selected a
"Project JRE" anywhere. I want to use Eclipse defaults for all projects.

Why does Eclipse think that I selected a JRE for the project? I use
Workspace Defaults for everything. And where would I select one anyway?

I'm using Eclipse 3.2.2 Build id: M20070212-1330, updated today.
Re: Eclipse selects wrong JRE [message #200926 is a reply to message #200893] Wed, 21 March 2007 13:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: csae7511.uibk.ac.at

Hi,

probably you have some local settings for your project - check if they
are correct: Right click on your project --> properties --> Java Compiler.

HTH,
Stefan

Chris schrieb:
> I have three JREs installed into Eclipse. When I run a class, Eclipse
> always selects 1.4.2, even though I have set the default JRE to 1.5 or
> 1.6 in Window/Preferences/Installed JREs.
>
> All options under Execution Environments are unchecked. Checking them
> does not change this behavior.
>
> Under the Run... configuration for my executable class, the JRE table
> has "Project JRE 1.4.2" selected. If I change to an alternative JRE,
> then things work correctly. The trouble is that I never selected a
> "Project JRE" anywhere. I want to use Eclipse defaults for all projects.
>
> Why does Eclipse think that I selected a JRE for the project? I use
> Workspace Defaults for everything. And where would I select one anyway?
>
> I'm using Eclipse 3.2.2 Build id: M20070212-1330, updated today.
Re: Eclipse selects wrong JRE [message #200949 is a reply to message #200926] Wed, 21 March 2007 14:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: fake.phony_email_address.com

Stefan Zugal wrote:
> Hi,
>
> probably you have some local settings for your project - check if they
> are correct: Right click on your project --> properties --> Java Compiler.
>
> HTH,
> Stefan
>

I don't. If I click Java Compiler, "Enable project specific settings" is
unchecked. It's also unchecked for all children of the Java Compiler node.
Re: Eclipse selects wrong JRE [message #200957 is a reply to message #200949] Wed, 21 March 2007 16:35 Go to previous messageGo to next message
Eclipse UserFriend
Chris wrote:
> Stefan Zugal wrote:
>> Hi,
>>
>> probably you have some local settings for your project - check if they
>> are correct: Right click on your project --> properties --> Java
>> Compiler.
>>
>> HTH,
>> Stefan
>>
>
> I don't. If I click Java Compiler, "Enable project specific settings" is
> unchecked. It's also unchecked for all children of the Java Compiler node.

What are your settings at:
Window->Preferences->Installed JRE's?

This is where you can change the JRE you wish to use.
Ray
Re: Eclipse selects wrong JRE [message #200965 is a reply to message #200957] Wed, 21 March 2007 16:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: fake.phony_email_address.com

Ray Hurst wrote:
> Chris wrote:
>> Stefan Zugal wrote:
>>> Hi,
>>>
>>> probably you have some local settings for your project - check if
>>> they are correct: Right click on your project --> properties --> Java
>>> Compiler.
>>>
>>> HTH,
>>> Stefan
>>>
>>
>> I don't. If I click Java Compiler, "Enable project specific settings"
>> is unchecked. It's also unchecked for all children of the Java
>> Compiler node.
>
> What are your settings at:
> Window->Preferences->Installed JRE's?
>
> This is where you can change the JRE you wish to use.
> Ray

Windows/Preferences/Java/Installed JREs has 1.5 checked. It still runs
1.4. Same result if 1.6 is checked.
Re: Eclipse selects wrong JRE [message #200979 is a reply to message #200965] Wed, 21 March 2007 17:42 Go to previous messageGo to next message
Eclipse UserFriend
Chris wrote:
> Ray Hurst wrote:
>> Chris wrote:
>>> Stefan Zugal wrote:
>>>> Hi,
>>>>
>>>> probably you have some local settings for your project - check if
>>>> they are correct: Right click on your project --> properties -->
>>>> Java Compiler.
>>>>
>>>> HTH,
>>>> Stefan
>>>>
>>>
>>> I don't. If I click Java Compiler, "Enable project specific settings"
>>> is unchecked. It's also unchecked for all children of the Java
>>> Compiler node.
>>
>> What are your settings at:
>> Window->Preferences->Installed JRE's?
>>
>> This is where you can change the JRE you wish to use.
>> Ray
>
> Windows/Preferences/Java/Installed JREs has 1.5 checked. It still runs
> 1.4. Same result if 1.6 is checked.
What OS are you running?

I use Windows XP.
If windows then go into a console window do the following:

cd \windows\system32
java -showversion

Ray
Re: Eclipse selects wrong JRE [message #200987 is a reply to message #200965] Wed, 21 March 2007 17:45 Go to previous messageGo to next message
Eclipse UserFriend
Chris wrote:

>
> Windows/Preferences/Java/Installed JREs has 1.5 checked. It still runs
> 1.4. Same result if 1.6 is checked.

Does this happen with new projects, or just existing ones? (I'm
wondering if the compiler was set to 1.4.2 when the project was started,
and that setting has just lingered.) Also, does the behavior change if
you start eclipse with the -clean switch?

/Paul
Re: Eclipse selects wrong JRE [message #200995 is a reply to message #200965] Wed, 21 March 2007 17:47 Go to previous messageGo to next message
Eclipse UserFriend
Chris wrote:
> Ray Hurst wrote:
>> Chris wrote:
>>> Stefan Zugal wrote:
>>>> Hi,
>>>>
>>>> probably you have some local settings for your project - check if
>>>> they are correct: Right click on your project --> properties -->
>>>> Java Compiler.
>>>>
>>>> HTH,
>>>> Stefan
>>>>
>>>
>>> I don't. If I click Java Compiler, "Enable project specific settings"
>>> is unchecked. It's also unchecked for all children of the Java
>>> Compiler node.
>>
>> What are your settings at:
>> Window->Preferences->Installed JRE's?
>>
>> This is where you can change the JRE you wish to use.
>> Ray
>
> Windows/Preferences/Java/Installed JREs has 1.5 checked. It still runs
> 1.4. Same result if 1.6 is checked.

I forgot to mention that you can force it on the command line by using
the switch -vm "pathToJava"
Ray
Re: Eclipse selects wrong JRE [message #201003 is a reply to message #200893] Wed, 21 March 2007 18:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wharley.bea.com

"Chris" <fake@phony_email_address.com> wrote in message
news:etrkmi$ik3$1@utils.eclipse.org...
>I have three JREs installed into Eclipse. When I run a class, Eclipse
>always selects 1.4.2, even though I have set the default JRE to 1.5 or 1.6
>in Window/Preferences/Installed JREs.
>
> All options under Execution Environments are unchecked. Checking them does
> not change this behavior.
>
> Under the Run... configuration for my executable class, the JRE table has
> "Project JRE 1.4.2" selected. If I change to an alternative JRE, then
> things work correctly. The trouble is that I never selected a "Project
> JRE" anywhere. I want to use Eclipse defaults for all projects.
>
> Why does Eclipse think that I selected a JRE for the project? I use
> Workspace Defaults for everything. And where would I select one anyway?
>
> I'm using Eclipse 3.2.2 Build id: M20070212-1330, updated today.


As a sanity check, I just took Eclipse 3.2.2, running under a 1.5.0_07 VM,
and created a new workspace and a new project in it. I added JREs for
1.4.2_08 and 1.6.0, leaving 1.5 as the default JRE. I set the compiler
compliance for the project to 1.4. I made no other modifications to
preferences or project properties. I then wrote a simple Main class:

package p;
public class Main {
public static void main(String[] args) {
String version = System.getProperty("java.version");
System.out.println(version);
}
}

and executed that class. It outputs "1.5.0_07" when the default JRE is 1.5.
Switching the default JRE to 1.4 or 1.6, and running again, without changing
anything else, the output tracks accordingly.

I wonder what is different for you?
Re: Eclipse selects wrong JRE [message #201011 is a reply to message #200979] Wed, 21 March 2007 20:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: fake.phony_email_address.com

> What OS are you running?
>
> I use Windows XP.
> If windows then go into a console window do the following:
>
> cd \windows\system32
> java -showversion

Using XP. java -version says:
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode)
Re: Eclipse selects wrong JRE [message #201019 is a reply to message #200987] Wed, 21 March 2007 20:22 Go to previous message
Eclipse UserFriend
Originally posted by: fake.phony_email_address.com

Paul Rubin wrote:
> Chris wrote:
>
>>
>> Windows/Preferences/Java/Installed JREs has 1.5 checked. It still runs
>> 1.4. Same result if 1.6 is checked.
>
> Does this happen with new projects, or just existing ones? (I'm
> wondering if the compiler was set to 1.4.2 when the project was started,
> and that setting has just lingered.) Also, does the behavior change if
> you start eclipse with the -clean switch?
>
> /Paul
>

Thank you. Testing with a new project led me to the solution.

There was something strange in my old project under
Project/Properties/Java Build Path/Libraries. It listed the 1.4.2
library. This is normal. What wasn't normal is that it didn't change
when I changed the default JRE.

It *did* change for a new project, though. So I deleted the entry,
re-added it using Add Library... and everything was cool.

So yes, it was junk in the old project file.
Previous Topic:MultiPageEditor Wizard seems broken in 3.2.2
Next Topic:making jar
Goto Forum:
  


Current Time: Fri May 02 16:07:58 EDT 2025

Powered by FUDForum. Page generated in 0.08634 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top