How to acquire a specific piug-in location path at runtime? [message #66238] |
Thu, 16 December 2004 05:31 |
Eclipse User |
|
|
|
Originally posted by: cavalier_hill.hotmail.com
Hi guys,
I am having a question about how to acquire a specific plug-in (say, the
plug-in with ID "pluginA") location path from the plug-in registry of
Eclipse runtime by using a Java application(or at least how to get the
Eclipse platform runtime installation location path from the Java
application) . It seems the "org.eclipse.core.runtime.Platform" class
could be a possible entry point but the fact is that an
"AssertionFailedException" was always thrown when I tried to use this
class. I have asked this problem in "Eclipse platform" board but so far no
comments were posted...
The following is the sample code that I tried to acquire the Eclipse
platform runtime installation location path:
//-------------------------------------------------
import org.eclipse.core.runtime.Platform;
public class Ptest {
public static void main(String[] args) {
System.out.println(Platform.getInstallLocation().toString()) ;
}
}
//-------------------------------------------------
And the following is the exception thrown out during execution:
org.eclipse.core.internal.runtime.AssertionFailedException: assertion
failed: The application has not been initialized.
at org.eclipse.core.internal.runtime.Assert.isTrue(Assert.java: 107)
at
org.eclipse.core.internal.runtime.InternalPlatform.assertIni tialized(InternalPlatform.java:216)
at
org.eclipse.core.internal.runtime.InternalPlatform.getInstal lLocation(InternalPlatform.java:1161)
at org.eclipse.core.runtime.Platform.getInstallLocation(Platfor m.java:1146)
at model.presentation.Ptest.main(Ptest.java:19)
Exception in thread "main"
|
|
|
Powered by
FUDForum. Page generated in 0.02423 seconds