Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » The -vm parameter not working(eclipse -vm)
The -vm parameter not working [message #729088] Sun, 25 September 2011 02:44 Go to next message
John Shen is currently offline John ShenFriend
Messages: 1
Registered: September 2011
Junior Member
Hi,

I want to switch jdk from windows command line while starting up eclipse. First I built directory structure as follows:

/ide/
-- /eclipse/
-- /j2sdk/
---- /jdk1.5.0_14/
---- /jdk1.6.0_24/
-- /workspace/
-- /eclipse1.5.cmd
-- /eclipse1.6.cmd

I put eclipse helios under "eclipse/" directory, jdk1.5 under "j2sdk/jdk1.5.0_14/", jdk1.6 under "j2sdk/jdk1.6.0_24/" and my projects under "workspace/".

Then I created two ".cmd" files: eclipse1.5.cmd and eclipse1.6.cmd.
In eclipse1.5.cmd:
start .\eclipse\eclipse.exe -vm .\j2sdk\jdk1.5.0_14\bin\javaw.exe -data .\workspace


In eclipse1.6.cmd:
start .\eclipse\eclipse.exe -vm .\j2sdk\jdk1.6.0_24\bin\javaw.exe -data .\workspace


What I expect is when I want to use jdk1.5, I double click to run "eclipse1.5.cmd", and If I want to use jdk1.6, I run "eclipse1.6.cmd".

However, it doesn't work in that way. Seems that if I run "eclipse1.5.cmd" first, it always shows "jdk1.5.0_14" in the "Window -> Prefernces -> Java -> Installed JREs", even I run "eclipse1.6.cmd" later. And the same thing happened vcie versa, if I run "eclipse1.6.cmd" first the Installed JREs will always be jdk1.6.0_24.

Anyone could help to explain and tell me how can I fix it?

Thanks
Re: The -vm parameter not working [message #729103 is a reply to message #729088] Sun, 25 September 2011 03:51 Go to previous message
David Wegener is currently offline David WegenerFriend
Messages: 1445
Registered: July 2009
Senior Member
On 09/24/2011 09:44 PM, John Shen wrote:
> Hi,
>
> I want to switch jdk from windows command line while starting up
> eclipse. First I built directory structure as follows:
>
> /ide/
> -- /eclipse/
> -- /j2sdk/
> ---- /jdk1.5.0_14/
> ---- /jdk1.6.0_24/
> -- /workspace/
> -- /eclipse1.5.cmd
> -- /eclipse1.6.cmd
>
> I put eclipse helios under "eclipse/" directory, jdk1.5 under
> "j2sdk/jdk1.5.0_14/", jdk1.6 under "j2sdk/jdk1.6.0_24/" and my projects
> under "workspace/".
>
> Then I created two ".cmd" files: eclipse1.5.cmd and eclipse1.6.cmd.
> In eclipse1.5.cmd:
> start .\eclipse\eclipse.exe -vm .\j2sdk\jdk1.5.0_14\bin\javaw.exe -data
> .\workspace
>
> In eclipse1.6.cmd:
> start .\eclipse\eclipse.exe -vm .\j2sdk\jdk1.6.0_24\bin\javaw.exe -data
> .\workspace
>
> What I expect is when I want to use jdk1.5, I double click to run
> "eclipse1.5.cmd", and If I want to use jdk1.6, I run "eclipse1.6.cmd".
>
> However, it doesn't work in that way. Seems that if I run
> "eclipse1.5.cmd" first, it always shows "jdk1.5.0_14" in the "Window ->
> Prefernces -> Java -> Installed JREs", even I run "eclipse1.6.cmd"
> later. And the same thing happened vcie versa, if I run "eclipse1.6.cmd"
> first the Installed JREs will always be jdk1.6.0_24.
>
> Anyone could help to explain and tell me how can I fix it?
>
> Thanks
The -vm parameter only tells Eclipse which VM to use to run the IDE. It
does not control the default jdk/jre for your workspace. Once you
define a default jdk/jre in the workspace, it doesn't change.

When Eclipse creates a workspace, it assigns the running VM as the
default jdk/jre. Subsequent starts of the workspace will continue to
use this jdk/jre.

Why do you want to keep changing the workspace default jdk/jre? One way
to accomplish this is to have separate workspaces one with a 1.5 default
and one with a 1.6 default. If you have specific projects that require
a 1.5 jdk, you can set a Project Specific jdk/jre in the Properties dialog.

I wouldn't recommend switching the vm used to run Eclipse. I would
recommend that you always run with the most up to date VM unless there
is a known bug that effects Eclipse. That way, you get all of the most
recent VM bug fixes to prevent problems in Eclipse. You can run using
1.6 VM but develop against a 1.5 jdk/jre.
Re: The -vm parameter not working [message #729105 is a reply to message #729088] Sun, 25 September 2011 03:51 Go to previous message
David Wegener is currently offline David WegenerFriend
Messages: 1445
Registered: July 2009
Senior Member
On 09/24/2011 09:44 PM, John Shen wrote:
> Hi,
>
> I want to switch jdk from windows command line while starting up
> eclipse. First I built directory structure as follows:
>
> /ide/
> -- /eclipse/
> -- /j2sdk/
> ---- /jdk1.5.0_14/
> ---- /jdk1.6.0_24/
> -- /workspace/
> -- /eclipse1.5.cmd
> -- /eclipse1.6.cmd
>
> I put eclipse helios under "eclipse/" directory, jdk1.5 under
> "j2sdk/jdk1.5.0_14/", jdk1.6 under "j2sdk/jdk1.6.0_24/" and my projects
> under "workspace/".
>
> Then I created two ".cmd" files: eclipse1.5.cmd and eclipse1.6.cmd.
> In eclipse1.5.cmd:
> start .\eclipse\eclipse.exe -vm .\j2sdk\jdk1.5.0_14\bin\javaw.exe -data
> .\workspace
>
> In eclipse1.6.cmd:
> start .\eclipse\eclipse.exe -vm .\j2sdk\jdk1.6.0_24\bin\javaw.exe -data
> .\workspace
>
> What I expect is when I want to use jdk1.5, I double click to run
> "eclipse1.5.cmd", and If I want to use jdk1.6, I run "eclipse1.6.cmd".
>
> However, it doesn't work in that way. Seems that if I run
> "eclipse1.5.cmd" first, it always shows "jdk1.5.0_14" in the "Window ->
> Prefernces -> Java -> Installed JREs", even I run "eclipse1.6.cmd"
> later. And the same thing happened vcie versa, if I run "eclipse1.6.cmd"
> first the Installed JREs will always be jdk1.6.0_24.
>
> Anyone could help to explain and tell me how can I fix it?
>
> Thanks
The -vm parameter only tells Eclipse which VM to use to run the IDE. It
does not control the default jdk/jre for your workspace. Once you
define a default jdk/jre in the workspace, it doesn't change.

When Eclipse creates a workspace, it assigns the running VM as the
default jdk/jre. Subsequent starts of the workspace will continue to
use this jdk/jre.

Why do you want to keep changing the workspace default jdk/jre? One way
to accomplish this is to have separate workspaces one with a 1.5 default
and one with a 1.6 default. If you have specific projects that require
a 1.5 jdk, you can set a Project Specific jdk/jre in the Properties dialog.

I wouldn't recommend switching the vm used to run Eclipse. I would
recommend that you always run with the most up to date VM unless there
is a known bug that effects Eclipse. That way, you get all of the most
recent VM bug fixes to prevent problems in Eclipse. You can run using
1.6 VM but develop against a 1.5 jdk/jre.
Re: The -vm parameter not working [message #729107 is a reply to message #729088] Sun, 25 September 2011 03:51 Go to previous message
David Wegener is currently offline David WegenerFriend
Messages: 1445
Registered: July 2009
Senior Member
On 09/24/2011 09:44 PM, John Shen wrote:
> Hi,
>
> I want to switch jdk from windows command line while starting up
> eclipse. First I built directory structure as follows:
>
> /ide/
> -- /eclipse/
> -- /j2sdk/
> ---- /jdk1.5.0_14/
> ---- /jdk1.6.0_24/
> -- /workspace/
> -- /eclipse1.5.cmd
> -- /eclipse1.6.cmd
>
> I put eclipse helios under "eclipse/" directory, jdk1.5 under
> "j2sdk/jdk1.5.0_14/", jdk1.6 under "j2sdk/jdk1.6.0_24/" and my projects
> under "workspace/".
>
> Then I created two ".cmd" files: eclipse1.5.cmd and eclipse1.6.cmd.
> In eclipse1.5.cmd:
> start .\eclipse\eclipse.exe -vm .\j2sdk\jdk1.5.0_14\bin\javaw.exe -data
> .\workspace
>
> In eclipse1.6.cmd:
> start .\eclipse\eclipse.exe -vm .\j2sdk\jdk1.6.0_24\bin\javaw.exe -data
> .\workspace
>
> What I expect is when I want to use jdk1.5, I double click to run
> "eclipse1.5.cmd", and If I want to use jdk1.6, I run "eclipse1.6.cmd".
>
> However, it doesn't work in that way. Seems that if I run
> "eclipse1.5.cmd" first, it always shows "jdk1.5.0_14" in the "Window ->
> Prefernces -> Java -> Installed JREs", even I run "eclipse1.6.cmd"
> later. And the same thing happened vcie versa, if I run "eclipse1.6.cmd"
> first the Installed JREs will always be jdk1.6.0_24.
>
> Anyone could help to explain and tell me how can I fix it?
>
> Thanks
The -vm parameter only tells Eclipse which VM to use to run the IDE. It
does not control the default jdk/jre for your workspace. Once you
define a default jdk/jre in the workspace, it doesn't change.

When Eclipse creates a workspace, it assigns the running VM as the
default jdk/jre. Subsequent starts of the workspace will continue to
use this jdk/jre.

Why do you want to keep changing the workspace default jdk/jre? One way
to accomplish this is to have separate workspaces one with a 1.5 default
and one with a 1.6 default. If you have specific projects that require
a 1.5 jdk, you can set a Project Specific jdk/jre in the Properties dialog.

I wouldn't recommend switching the vm used to run Eclipse. I would
recommend that you always run with the most up to date VM unless there
is a known bug that effects Eclipse. That way, you get all of the most
recent VM bug fixes to prevent problems in Eclipse. You can run using
1.6 VM but develop against a 1.5 jdk/jre.
Re: The -vm parameter not working [message #729109 is a reply to message #729088] Sun, 25 September 2011 03:51 Go to previous message
David Wegener is currently offline David WegenerFriend
Messages: 1445
Registered: July 2009
Senior Member
On 09/24/2011 09:44 PM, John Shen wrote:
> Hi,
>
> I want to switch jdk from windows command line while starting up
> eclipse. First I built directory structure as follows:
>
> /ide/
> -- /eclipse/
> -- /j2sdk/
> ---- /jdk1.5.0_14/
> ---- /jdk1.6.0_24/
> -- /workspace/
> -- /eclipse1.5.cmd
> -- /eclipse1.6.cmd
>
> I put eclipse helios under "eclipse/" directory, jdk1.5 under
> "j2sdk/jdk1.5.0_14/", jdk1.6 under "j2sdk/jdk1.6.0_24/" and my projects
> under "workspace/".
>
> Then I created two ".cmd" files: eclipse1.5.cmd and eclipse1.6.cmd.
> In eclipse1.5.cmd:
> start .\eclipse\eclipse.exe -vm .\j2sdk\jdk1.5.0_14\bin\javaw.exe -data
> .\workspace
>
> In eclipse1.6.cmd:
> start .\eclipse\eclipse.exe -vm .\j2sdk\jdk1.6.0_24\bin\javaw.exe -data
> .\workspace
>
> What I expect is when I want to use jdk1.5, I double click to run
> "eclipse1.5.cmd", and If I want to use jdk1.6, I run "eclipse1.6.cmd".
>
> However, it doesn't work in that way. Seems that if I run
> "eclipse1.5.cmd" first, it always shows "jdk1.5.0_14" in the "Window ->
> Prefernces -> Java -> Installed JREs", even I run "eclipse1.6.cmd"
> later. And the same thing happened vcie versa, if I run "eclipse1.6.cmd"
> first the Installed JREs will always be jdk1.6.0_24.
>
> Anyone could help to explain and tell me how can I fix it?
>
> Thanks
The -vm parameter only tells Eclipse which VM to use to run the IDE. It
does not control the default jdk/jre for your workspace. Once you
define a default jdk/jre in the workspace, it doesn't change.

When Eclipse creates a workspace, it assigns the running VM as the
default jdk/jre. Subsequent starts of the workspace will continue to
use this jdk/jre.

Why do you want to keep changing the workspace default jdk/jre? One way
to accomplish this is to have separate workspaces one with a 1.5 default
and one with a 1.6 default. If you have specific projects that require
a 1.5 jdk, you can set a Project Specific jdk/jre in the Properties dialog.

I wouldn't recommend switching the vm used to run Eclipse. I would
recommend that you always run with the most up to date VM unless there
is a known bug that effects Eclipse. That way, you get all of the most
recent VM bug fixes to prevent problems in Eclipse. You can run using
1.6 VM but develop against a 1.5 jdk/jre.
Re: The -vm parameter not working [message #729114 is a reply to message #729088] Sun, 25 September 2011 03:51 Go to previous message
David Wegener is currently offline David WegenerFriend
Messages: 1445
Registered: July 2009
Senior Member
On 09/24/2011 09:44 PM, John Shen wrote:
> Hi,
>
> I want to switch jdk from windows command line while starting up
> eclipse. First I built directory structure as follows:
>
> /ide/
> -- /eclipse/
> -- /j2sdk/
> ---- /jdk1.5.0_14/
> ---- /jdk1.6.0_24/
> -- /workspace/
> -- /eclipse1.5.cmd
> -- /eclipse1.6.cmd
>
> I put eclipse helios under "eclipse/" directory, jdk1.5 under
> "j2sdk/jdk1.5.0_14/", jdk1.6 under "j2sdk/jdk1.6.0_24/" and my projects
> under "workspace/".
>
> Then I created two ".cmd" files: eclipse1.5.cmd and eclipse1.6.cmd.
> In eclipse1.5.cmd:
> start .\eclipse\eclipse.exe -vm .\j2sdk\jdk1.5.0_14\bin\javaw.exe -data
> .\workspace
>
> In eclipse1.6.cmd:
> start .\eclipse\eclipse.exe -vm .\j2sdk\jdk1.6.0_24\bin\javaw.exe -data
> .\workspace
>
> What I expect is when I want to use jdk1.5, I double click to run
> "eclipse1.5.cmd", and If I want to use jdk1.6, I run "eclipse1.6.cmd".
>
> However, it doesn't work in that way. Seems that if I run
> "eclipse1.5.cmd" first, it always shows "jdk1.5.0_14" in the "Window ->
> Prefernces -> Java -> Installed JREs", even I run "eclipse1.6.cmd"
> later. And the same thing happened vcie versa, if I run "eclipse1.6.cmd"
> first the Installed JREs will always be jdk1.6.0_24.
>
> Anyone could help to explain and tell me how can I fix it?
>
> Thanks
The -vm parameter only tells Eclipse which VM to use to run the IDE. It
does not control the default jdk/jre for your workspace. Once you
define a default jdk/jre in the workspace, it doesn't change.

When Eclipse creates a workspace, it assigns the running VM as the
default jdk/jre. Subsequent starts of the workspace will continue to
use this jdk/jre.

Why do you want to keep changing the workspace default jdk/jre? One way
to accomplish this is to have separate workspaces one with a 1.5 default
and one with a 1.6 default. If you have specific projects that require
a 1.5 jdk, you can set a Project Specific jdk/jre in the Properties dialog.

I wouldn't recommend switching the vm used to run Eclipse. I would
recommend that you always run with the most up to date VM unless there
is a known bug that effects Eclipse. That way, you get all of the most
recent VM bug fixes to prevent problems in Eclipse. You can run using
1.6 VM but develop against a 1.5 jdk/jre.
Re: The -vm parameter not working [message #729115 is a reply to message #729088] Sun, 25 September 2011 03:51 Go to previous message
David Wegener is currently offline David WegenerFriend
Messages: 1445
Registered: July 2009
Senior Member
On 09/24/2011 09:44 PM, John Shen wrote:
> Hi,
>
> I want to switch jdk from windows command line while starting up
> eclipse. First I built directory structure as follows:
>
> /ide/
> -- /eclipse/
> -- /j2sdk/
> ---- /jdk1.5.0_14/
> ---- /jdk1.6.0_24/
> -- /workspace/
> -- /eclipse1.5.cmd
> -- /eclipse1.6.cmd
>
> I put eclipse helios under "eclipse/" directory, jdk1.5 under
> "j2sdk/jdk1.5.0_14/", jdk1.6 under "j2sdk/jdk1.6.0_24/" and my projects
> under "workspace/".
>
> Then I created two ".cmd" files: eclipse1.5.cmd and eclipse1.6.cmd.
> In eclipse1.5.cmd:
> start .\eclipse\eclipse.exe -vm .\j2sdk\jdk1.5.0_14\bin\javaw.exe -data
> .\workspace
>
> In eclipse1.6.cmd:
> start .\eclipse\eclipse.exe -vm .\j2sdk\jdk1.6.0_24\bin\javaw.exe -data
> .\workspace
>
> What I expect is when I want to use jdk1.5, I double click to run
> "eclipse1.5.cmd", and If I want to use jdk1.6, I run "eclipse1.6.cmd".
>
> However, it doesn't work in that way. Seems that if I run
> "eclipse1.5.cmd" first, it always shows "jdk1.5.0_14" in the "Window ->
> Prefernces -> Java -> Installed JREs", even I run "eclipse1.6.cmd"
> later. And the same thing happened vcie versa, if I run "eclipse1.6.cmd"
> first the Installed JREs will always be jdk1.6.0_24.
>
> Anyone could help to explain and tell me how can I fix it?
>
> Thanks
The -vm parameter only tells Eclipse which VM to use to run the IDE. It
does not control the default jdk/jre for your workspace. Once you
define a default jdk/jre in the workspace, it doesn't change.

When Eclipse creates a workspace, it assigns the running VM as the
default jdk/jre. Subsequent starts of the workspace will continue to
use this jdk/jre.

Why do you want to keep changing the workspace default jdk/jre? One way
to accomplish this is to have separate workspaces one with a 1.5 default
and one with a 1.6 default. If you have specific projects that require
a 1.5 jdk, you can set a Project Specific jdk/jre in the Properties dialog.

I wouldn't recommend switching the vm used to run Eclipse. I would
recommend that you always run with the most up to date VM unless there
is a known bug that effects Eclipse. That way, you get all of the most
recent VM bug fixes to prevent problems in Eclipse. You can run using
1.6 VM but develop against a 1.5 jdk/jre.
Re: The -vm parameter not working [message #729116 is a reply to message #729088] Sun, 25 September 2011 03:51 Go to previous message
David Wegener is currently offline David WegenerFriend
Messages: 1445
Registered: July 2009
Senior Member
On 09/24/2011 09:44 PM, John Shen wrote:
> Hi,
>
> I want to switch jdk from windows command line while starting up
> eclipse. First I built directory structure as follows:
>
> /ide/
> -- /eclipse/
> -- /j2sdk/
> ---- /jdk1.5.0_14/
> ---- /jdk1.6.0_24/
> -- /workspace/
> -- /eclipse1.5.cmd
> -- /eclipse1.6.cmd
>
> I put eclipse helios under "eclipse/" directory, jdk1.5 under
> "j2sdk/jdk1.5.0_14/", jdk1.6 under "j2sdk/jdk1.6.0_24/" and my projects
> under "workspace/".
>
> Then I created two ".cmd" files: eclipse1.5.cmd and eclipse1.6.cmd.
> In eclipse1.5.cmd:
> start .\eclipse\eclipse.exe -vm .\j2sdk\jdk1.5.0_14\bin\javaw.exe -data
> .\workspace
>
> In eclipse1.6.cmd:
> start .\eclipse\eclipse.exe -vm .\j2sdk\jdk1.6.0_24\bin\javaw.exe -data
> .\workspace
>
> What I expect is when I want to use jdk1.5, I double click to run
> "eclipse1.5.cmd", and If I want to use jdk1.6, I run "eclipse1.6.cmd".
>
> However, it doesn't work in that way. Seems that if I run
> "eclipse1.5.cmd" first, it always shows "jdk1.5.0_14" in the "Window ->
> Prefernces -> Java -> Installed JREs", even I run "eclipse1.6.cmd"
> later. And the same thing happened vcie versa, if I run "eclipse1.6.cmd"
> first the Installed JREs will always be jdk1.6.0_24.
>
> Anyone could help to explain and tell me how can I fix it?
>
> Thanks
The -vm parameter only tells Eclipse which VM to use to run the IDE. It
does not control the default jdk/jre for your workspace. Once you
define a default jdk/jre in the workspace, it doesn't change.

When Eclipse creates a workspace, it assigns the running VM as the
default jdk/jre. Subsequent starts of the workspace will continue to
use this jdk/jre.

Why do you want to keep changing the workspace default jdk/jre? One way
to accomplish this is to have separate workspaces one with a 1.5 default
and one with a 1.6 default. If you have specific projects that require
a 1.5 jdk, you can set a Project Specific jdk/jre in the Properties dialog.

I wouldn't recommend switching the vm used to run Eclipse. I would
recommend that you always run with the most up to date VM unless there
is a known bug that effects Eclipse. That way, you get all of the most
recent VM bug fixes to prevent problems in Eclipse. You can run using
1.6 VM but develop against a 1.5 jdk/jre.
Re: The -vm parameter not working [message #729121 is a reply to message #729088] Sun, 25 September 2011 03:51 Go to previous message
David Wegener is currently offline David WegenerFriend
Messages: 1445
Registered: July 2009
Senior Member
On 09/24/2011 09:44 PM, John Shen wrote:
> Hi,
>
> I want to switch jdk from windows command line while starting up
> eclipse. First I built directory structure as follows:
>
> /ide/
> -- /eclipse/
> -- /j2sdk/
> ---- /jdk1.5.0_14/
> ---- /jdk1.6.0_24/
> -- /workspace/
> -- /eclipse1.5.cmd
> -- /eclipse1.6.cmd
>
> I put eclipse helios under "eclipse/" directory, jdk1.5 under
> "j2sdk/jdk1.5.0_14/", jdk1.6 under "j2sdk/jdk1.6.0_24/" and my projects
> under "workspace/".
>
> Then I created two ".cmd" files: eclipse1.5.cmd and eclipse1.6.cmd.
> In eclipse1.5.cmd:
> start .\eclipse\eclipse.exe -vm .\j2sdk\jdk1.5.0_14\bin\javaw.exe -data
> .\workspace
>
> In eclipse1.6.cmd:
> start .\eclipse\eclipse.exe -vm .\j2sdk\jdk1.6.0_24\bin\javaw.exe -data
> .\workspace
>
> What I expect is when I want to use jdk1.5, I double click to run
> "eclipse1.5.cmd", and If I want to use jdk1.6, I run "eclipse1.6.cmd".
>
> However, it doesn't work in that way. Seems that if I run
> "eclipse1.5.cmd" first, it always shows "jdk1.5.0_14" in the "Window ->
> Prefernces -> Java -> Installed JREs", even I run "eclipse1.6.cmd"
> later. And the same thing happened vcie versa, if I run "eclipse1.6.cmd"
> first the Installed JREs will always be jdk1.6.0_24.
>
> Anyone could help to explain and tell me how can I fix it?
>
> Thanks
The -vm parameter only tells Eclipse which VM to use to run the IDE. It
does not control the default jdk/jre for your workspace. Once you
define a default jdk/jre in the workspace, it doesn't change.

When Eclipse creates a workspace, it assigns the running VM as the
default jdk/jre. Subsequent starts of the workspace will continue to
use this jdk/jre.

Why do you want to keep changing the workspace default jdk/jre? One way
to accomplish this is to have separate workspaces one with a 1.5 default
and one with a 1.6 default. If you have specific projects that require
a 1.5 jdk, you can set a Project Specific jdk/jre in the Properties dialog.

I wouldn't recommend switching the vm used to run Eclipse. I would
recommend that you always run with the most up to date VM unless there
is a known bug that effects Eclipse. That way, you get all of the most
recent VM bug fixes to prevent problems in Eclipse. You can run using
1.6 VM but develop against a 1.5 jdk/jre.
Previous Topic:Can't get junit to work in Eclipse
Next Topic:Error updating Eclipse IDE for Java EE Developers
Goto Forum:
  


Current Time: Fri Apr 26 07:32:56 GMT 2024

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

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

Back to the top