Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » How to get list of installed vms
How to get list of installed vms [message #250792] Tue, 22 January 2008 10:39 Go to next message
Eclipse UserFriend
Originally posted by: Bernd.Eggink.monoped.de

I need a list of all installed VMs known by Eclipse. Any ideas how to get
it?

Bernd
Re: How to get list of installed vms [message #250808 is a reply to message #250792] Tue, 22 January 2008 19:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rob.brainkandy-dot-org.org

Bernd wrote:
> I need a list of all installed VMs known by Eclipse. Any ideas how to
> get it?
>
> Bernd
>

---
There are several _types_ of installed VMs. So the first thing you need to know
is which type of installed VM you are interested in. From there you can get the
IVMInstallType, which represents one of the groups of installed VMs.
---
Start with JavaRuntime.getVMInstallType(name). If you want to know the types of
VM Install names, see JavaRuntime.getVMInstallTypes() However it's likely you're
just looking for the standard VM install type:
"org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType"
---
From a VM Install type, you can reference a VM Install by its name or by its ID
using IVMInstallType.findVMInstall(id) and IVMInstallType.findVMInstallByName(id)

Again, you can find out all the installs by calling VMInstall[]
IVMInstallType.getVMInstalls().
---
Thanks, Robert
Re: How to get list of installed vms [message #250845 is a reply to message #250808] Wed, 23 January 2008 05:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Bernd.Eggink.monoped.de

Thanks. We tried the following on three different systems:

IVMInstallType[] installTypes = JavaRuntime.getVMInstallTypes();

for (int i = 0; i < installTypes.length; i++)
{
IVMInstallType type = installTypes[i];

System.out.println("Type: " + type.getName());
System.out.println("Installs:");

IVMInstall[] installs = type.getVMInstalls();

for (int j = 0; j < installs.length; j++)
System.out.println(installs[j].getName()
+ " Path: " + installs[j].getInstallLocation().getAbsolutePath());
}

This works great on a Windows system and even on a Mac of my friend.
However, on my own Linux box, where Eclipse shows about 10 entries in
"Preferences/Java/Installed JREs", it reports no more than 2 installs:

jdk1.6.0_03 Path: /local/java/jdk1.6.0_03
j2sdk1.4.2_12 Path: /local/java/j2sdk1.4.2_12

Any idea what the reason may be?

Regards,
Bernd
Re: How to get list of installed vms [message #250849 is a reply to message #250808] Wed, 23 January 2008 05:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: andre.grunow.c1-wps.de

Hi Robert,

thanks for your first approach!

We will try it and send feedback.

-Andre
Re: How to get list of installed vms [message #250853 is a reply to message #250808] Wed, 23 January 2008 05:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: andre.grunow.c1-wps.de

Thanks, Robert, for your approach.

The 2nd way is the right one for us. We'd like to avoid any dependency to
Eclipse internal classes.

We will send a feedback, when we tested it.

-Andre
Re: How to get list of installed vms [message #250892 is a reply to message #250845] Wed, 23 January 2008 16:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rob.brainkandy-dot-org.org

Bernd wrote:
> Thanks. We tried the following on three different systems:
>
> IVMInstallType[] installTypes = JavaRuntime.getVMInstallTypes();
>
> for (int i = 0; i < installTypes.length; i++)
> {
> IVMInstallType type = installTypes[i];
>
> System.out.println("Type: " + type.getName());
> System.out.println("Installs:");
>
> IVMInstall[] installs = type.getVMInstalls();
>
> for (int j = 0; j < installs.length; j++)
> System.out.println(installs[j].getName() + " Path: " +
> installs[j].getInstallLocation().getAbsolutePath());
> }
>
> This works great on a Windows system and even on a Mac of my friend.
> However, on my own Linux box, where Eclipse shows about 10 entries in
> "Preferences/Java/Installed JREs", it reports no more than 2 installs:
>
> jdk1.6.0_03 Path: /local/java/jdk1.6.0_03
> j2sdk1.4.2_12 Path: /local/java/j2sdk1.4.2_12
>
> Any idea what the reason may be?
>
> Regards,
> Bernd
>

Can you provide the _full_ output? Your code suggests more information, like
each install type.
Re: How to get list of installed vms [message #250896 is a reply to message #250853] Wed, 23 January 2008 16:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rob.brainkandy-dot-org.org

Andre Grunow wrote:
> Thanks, Robert, for your approach.
>
> The 2nd way is the right one for us. We'd like to avoid any dependency
> to Eclipse internal classes.
>
> We will send a feedback, when we tested it.
>
> -Andre
>
What second way are you talking about?
Re: How to get list of installed vms [message #250913 is a reply to message #250892] Thu, 24 January 2008 04:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Bernd.Eggink.monoped.de

Here it is:

Type: Standard VM
Installs:
jdk1.6.0_03 Path: /local/java/jdk1.6.0_03
j2sdk1.4.2_12 Path: /local/java/j2sdk1.4.2_12
Type: Standard 1.1.x VM
Installs:

Preferences/Java/InstalledJREs additionally lists the following Standard
VMs:

jdk1.5.0_14
jdk1.6.0_04
jdk1.7.0

as well as some symbolic links pointing to the same directories (created
by me).

Bernd
Re: How to get list of installed vms [message #250926 is a reply to message #250913] Thu, 24 January 2008 12:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rob.brainkandy-dot-org.org

Bernd wrote:
> Here it is:
>
> Type: Standard VM
> Installs:
> jdk1.6.0_03 Path: /local/java/jdk1.6.0_03
> j2sdk1.4.2_12 Path: /local/java/j2sdk1.4.2_12
> Type: Standard 1.1.x VM
> Installs:
>
> Preferences/Java/InstalledJREs additionally lists the following Standard
> VMs:
>
> jdk1.5.0_14
> jdk1.6.0_04
> jdk1.7.0
>
> as well as some symbolic links pointing to the same directories (created
> by me).
> Bernd
>
>
Interesting. I don't know. Can someone correct my suggested solution?
Re: How to get list of installed vms [message #250954 is a reply to message #250926] Fri, 25 January 2008 13:05 Go to previous message
Eclipse UserFriend
Originally posted by: Bernd.Eggink.monoped.de

Sorry, false alarm.

The confusion was caused by the fact that two different workspaces were
involved, with different VM settings.

Thanks anyway,
Bernd
Previous Topic:Unexpected exception while debugging
Next Topic:Open actual class definition while debuggin
Goto Forum:
  


Current Time: Sun May 25 01:54:43 EDT 2025

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

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

Back to the top