本文整理汇总了Java中org.eclipse.jdt.launching.JavaRuntime.resolveRuntimeClasspath方法的典型用法代码示例。如果您正苦于以下问题:Java JavaRuntime.resolveRuntimeClasspath方法的具体用法?Java JavaRuntime.resolveRuntimeClasspath怎么用?Java JavaRuntime.resolveRuntimeClasspath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.launching.JavaRuntime
的用法示例。
在下文中一共展示了JavaRuntime.resolveRuntimeClasspath方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRuntimeClasspaths
import org.eclipse.jdt.launching.JavaRuntime; //导入方法依赖的package包/类
protected IPath[] getRuntimeClasspaths(ILaunchConfiguration configuration)
throws CoreException {
IRuntimeClasspathEntry[] entries = JavaRuntime
.computeUnresolvedRuntimeClasspath(configuration);
entries = JavaRuntime.resolveRuntimeClasspath(entries, configuration);
ArrayList<IPath> userEntries = new ArrayList<IPath>(entries.length);
for (int i = 0; i < entries.length; i++) {
if (entries[i].getClasspathProperty() == IRuntimeClasspathEntry.USER_CLASSES) {
String location = entries[i].getLocation();
if (location != null) {
IPath entry = Path.fromOSString(location);
if (!userEntries.contains(entry)) {
userEntries.add(entry);
}
}
}
}
return userEntries.toArray(new IPath[userEntries.size()]);
}
示例2: getClasspath
import org.eclipse.jdt.launching.JavaRuntime; //导入方法依赖的package包/类
private static IPath[] getClasspath(ILaunchConfiguration configuration) throws CoreException {
IRuntimeClasspathEntry[] entries= JavaRuntime.computeUnresolvedRuntimeClasspath(configuration);
entries= JavaRuntime.resolveRuntimeClasspath(entries, configuration);
ArrayList<IPath> userEntries= new ArrayList<IPath>(entries.length);
for (int i= 0; i < entries.length; i++) {
if (entries[i].getClasspathProperty() == IRuntimeClasspathEntry.USER_CLASSES) {
String location= entries[i].getLocation();
if (location != null) {
IPath entry= Path.fromOSString(location);
if (!userEntries.contains(entry)) {
userEntries.add(entry);
}
}
}
}
return userEntries.toArray(new IPath[userEntries.size()]);
}
示例3: getClasspath
import org.eclipse.jdt.launching.JavaRuntime; //导入方法依赖的package包/类
public String[] getClasspath( ILaunchConfiguration configuration )
throws CoreException
{
ScriptDebugClasspathProvider provider = new ScriptDebugClasspathProvider( );
IRuntimeClasspathEntry[] entries = provider.computeExtraBootClasspath( configuration );
entries = JavaRuntime.resolveRuntimeClasspath( entries, configuration );
List userEntries = new ArrayList( entries.length );
Set set = new HashSet( entries.length );
for ( int i = 0; i < entries.length; i++ )
{
if ( entries[i].getClasspathProperty( ) == IRuntimeClasspathEntry.USER_CLASSES )
{
String location = entries[i].getLocation( );
if ( location != null )
{
if ( !set.contains( location ) )
{
userEntries.add( location );
set.add( location );
}
}
}
}
return (String[]) userEntries.toArray( new String[userEntries.size( )] );
}
示例4: getRawClasspathEntries
import org.eclipse.jdt.launching.JavaRuntime; //导入方法依赖的package包/类
private IClasspathEntry[] getRawClasspathEntries() {
IClasspathEntry[] result = null;
ILaunchConfiguration lc = getLaunchConfig();
if (lc != null) {
try {
Vector cpeList = new Vector();
// JavaRuntime.computeUnresolvedRuntimeClasspath(lc);
IRuntimeClasspathProvider rcp = JavaRuntime
.getClasspathProvider(lc);
if (rcp != null) {
IRuntimeClasspathEntry[] rawRcpes = rcp
.computeUnresolvedClasspath(lc);
IRuntimeClasspathEntry[] entries = JavaRuntime
.resolveRuntimeClasspath(rawRcpes, lc);
List userEntries = new ArrayList(entries.length);
for (int i = 0; i < entries.length; i++) {
if (entries[i].getClasspathProperty() == IRuntimeClasspathEntry.USER_CLASSES) {
String location = entries[i].getLocation();
if (location != null) {
System.out.println("cpe[" + i + "]='"
+ entries[i].getLocation() + "'");
IClasspathEntry cpe = entries[i]
.getClasspathEntry();
if (cpe != null) {
cpeList.add(cpe);
}
}
}
}
}
result = (IClasspathEntry[]) cpeList
.toArray(new IClasspathEntry[cpeList.size()]);
} catch (CoreException e) {
e.printStackTrace();
}
}
return result;
}
示例5: getUserClasspath
import org.eclipse.jdt.launching.JavaRuntime; //导入方法依赖的package包/类
private static String[] getUserClasspath( ILaunchConfiguration configuration )
{
try
{
ScriptDebugClasspathProvider provider = new ScriptDebugClasspathProvider( );
IRuntimeClasspathEntry[] entries = provider.computeUserClasspath( configuration );
entries = JavaRuntime.resolveRuntimeClasspath( entries,
configuration );
List userEntries = new ArrayList( );
Set set = new HashSet( entries.length );
for ( int i = 0; i < entries.length; i++ )
{
if ( entries[i].getClasspathProperty( ) == IRuntimeClasspathEntry.USER_CLASSES )
{
String location = entries[i].getLocation( );
if ( location != null )
{
if ( !set.contains( location ) )
{
userEntries.add( location );
set.add( location );
}
}
}
}
return (String[]) userEntries.toArray( new String[userEntries.size( )] );
}
catch ( CoreException e )
{
e.printStackTrace( );
}
return null;
}