|
Lines 45-50
Link Here
|
| 45 |
import org.eclipse.core.resources.ProjectScope; |
45 |
import org.eclipse.core.resources.ProjectScope; |
| 46 |
import org.eclipse.core.resources.ResourcesPlugin; |
46 |
import org.eclipse.core.resources.ResourcesPlugin; |
| 47 |
import org.eclipse.core.runtime.CoreException; |
47 |
import org.eclipse.core.runtime.CoreException; |
|
|
48 |
import org.eclipse.core.runtime.FileLocator; |
| 48 |
import org.eclipse.core.runtime.IPath; |
49 |
import org.eclipse.core.runtime.IPath; |
| 49 |
import org.eclipse.core.runtime.IProgressMonitor; |
50 |
import org.eclipse.core.runtime.IProgressMonitor; |
| 50 |
import org.eclipse.core.runtime.NullProgressMonitor; |
51 |
import org.eclipse.core.runtime.NullProgressMonitor; |
|
Lines 66-71
Link Here
|
| 66 |
import org.eclipse.jdt.core.JavaModelException; |
67 |
import org.eclipse.jdt.core.JavaModelException; |
| 67 |
import org.eclipse.jdt.launching.JavaRuntime; |
68 |
import org.eclipse.jdt.launching.JavaRuntime; |
| 68 |
import org.eclipse.jem.util.logger.proxy.Logger; |
69 |
import org.eclipse.jem.util.logger.proxy.Logger; |
|
|
70 |
import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; |
| 69 |
import org.eclipse.jst.j2ee.internal.plugin.J2EEPluginResourceHandler; |
71 |
import org.eclipse.jst.j2ee.internal.plugin.J2EEPluginResourceHandler; |
| 70 |
import org.eclipse.osgi.util.ManifestElement; |
72 |
import org.eclipse.osgi.util.ManifestElement; |
| 71 |
import org.osgi.framework.Bundle; |
73 |
import org.osgi.framework.Bundle; |
|
Lines 440-447
Link Here
|
| 440 |
IPath runtimeLibFullPath = null; |
442 |
IPath runtimeLibFullPath = null; |
| 441 |
URL fullurl = null; |
443 |
URL fullurl = null; |
| 442 |
if (elements == null) { |
444 |
if (elements == null) { |
| 443 |
if (bundle.getLocation().endsWith(".jar")) //$NON-NLS-1$ |
445 |
if (bundle.getLocation().endsWith(".jar")) |
| 444 |
runtimeLibFullPath = getJarredPluginPath(bundle); |
446 |
try { |
|
|
447 |
runtimeLibFullPath = getJarredPluginPath(bundle); |
| 448 |
} catch (IOException e) { |
| 449 |
J2EEPlugin.logError(e); |
| 450 |
} |
| 445 |
appendToClassPath(runtimeLibFullPath,project); |
451 |
appendToClassPath(runtimeLibFullPath,project); |
| 446 |
return; |
452 |
return; |
| 447 |
} |
453 |
} |
|
Lines 458-465
Link Here
|
| 458 |
Logger.getLogger().logError(e); |
464 |
Logger.getLogger().logError(e); |
| 459 |
} |
465 |
} |
| 460 |
//TODO handle jar'ed plugins, this is a hack for now, need to find proper bundle API |
466 |
//TODO handle jar'ed plugins, this is a hack for now, need to find proper bundle API |
| 461 |
if (bundle.getLocation().endsWith(".jar")) //$NON-NLS-1$ |
467 |
if (bundle.getLocation().endsWith(".jar")) |
| 462 |
runtimeLibFullPath = getJarredPluginPath(bundle); |
468 |
try { |
|
|
469 |
runtimeLibFullPath = getJarredPluginPath(bundle); |
| 470 |
} catch (IOException e) { |
| 471 |
J2EEPlugin.logError(e); |
| 472 |
} |
| 463 |
if (!"jar".equals(runtimeLibFullPath.getFileExtension()) && !"zip".equals(runtimeLibFullPath.getFileExtension())) //$NON-NLS-1$ //$NON-NLS-2$ |
473 |
if (!"jar".equals(runtimeLibFullPath.getFileExtension()) && !"zip".equals(runtimeLibFullPath.getFileExtension())) //$NON-NLS-1$ //$NON-NLS-2$ |
| 464 |
continue; |
474 |
continue; |
| 465 |
appendToClassPath(runtimeLibFullPath,project); |
475 |
appendToClassPath(runtimeLibFullPath,project); |
|
Lines 479-487
Link Here
|
| 479 |
} |
489 |
} |
| 480 |
} |
490 |
} |
| 481 |
|
491 |
|
| 482 |
private IPath getJarredPluginPath(Bundle bundle) { |
492 |
private IPath getJarredPluginPath(Bundle bundle) throws IOException { |
| 483 |
Path runtimeLibFullPath = null; |
493 |
Path runtimeLibFullPath = null; |
| 484 |
String jarPluginLocation = bundle.getLocation().substring(7); |
494 |
String jarPluginLocation = FileLocator.getBundleFile(bundle).getPath(); |
| 485 |
Path jarPluginPath = new Path(jarPluginLocation); |
495 |
Path jarPluginPath = new Path(jarPluginLocation); |
| 486 |
// handle case where jars are installed outside of eclipse installation |
496 |
// handle case where jars are installed outside of eclipse installation |
| 487 |
if (jarPluginPath.isAbsolute()) |
497 |
if (jarPluginPath.isAbsolute()) |