本文整理匯總了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;
}