Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Getting Server Runtime ClasspathEntry
Getting Server Runtime ClasspathEntry [message #222559] Thu, 02 October 2008 16:08 Go to next message
Philippe Sabourin is currently offline Philippe SabourinFriend
Messages: 28
Registered: July 2009
Junior Member
I'm trying to add a server runtime to a Java Project, and have been able
to using a static string:
org.eclipse.jst.server.core.container/org.eclipse.jst.server .tomcat.runtimeTarget/[RUNTIME
NAME] but I haven't figured out how to get this full string
programmatically. The only part I can get from the runtime (or the utility
classes) is the name. Is there any way to get that full string or a
prebuilt classpathentry object I can just insert into my class path (using
setRawClasspath).

Thanks,
Philippe
Re: Getting Server Runtime ClasspathEntry [message #222562 is a reply to message #222559] Thu, 02 October 2008 18:20 Go to previous message
Philippe Sabourin is currently offline Philippe SabourinFriend
Messages: 28
Registered: July 2009
Junior Member
Found the solution in ServerClasspathContainerPage
(org.eclipse.jst.server.ui.internal).

IRuntime[] runtimes = ServerCore.getRuntimes();
for (IRuntime runtime : runtimes) {
if (runtime.getRuntimeType() != null) {
RuntimeClasspathProviderWrapper rcpw =
JavaServerPlugin.findRuntimeClasspathProvider(runtime.getRun timeType());
if (rcpw != null) {
IPath serverContainerPath = new
Path(RuntimeClasspathContainer.SERVER_CONTAINER)
.append(rcpw.getId()).append(runtime.getId());
runtimeMap.put(runtime,
JavaCore.newContainerEntry(serverContainerPath));
}
}
}

This seems to work.
Previous Topic:Why does completion work with a DTD, but not with a schema?
Next Topic:Disable HTML validation for javadoc
Goto Forum:
  


Current Time: Fri Apr 19 07:47:58 GMT 2024

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

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

Back to the top