From this post, I have this error message when I tried to execute headless eclipse code.
java.lang.RuntimeException: Could not find framework
at org.eclipse.equinox.launcher.Main.getBootPath(Main.java:978)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:557)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
I googled to find this as an answer to issue: "Unable to acquire application service" error while launching Eclipse
However, I'm not exactly sure how to put the config.ini and how to put the correct content to remove the error message.
This is my directory structure, and I have Dosgi.bundles=org.eclipse.equinox.common@2:start,org.eclipse.update.configurator@3:start,org.eclipse.core.runtime@
inside the eclipse.ini file.
How do I setup the eclipse.ini file, and where the file should be located?
The jar files are in plugins
directory, and runme.sh
has this script:
R2_HOME=.
LIBS=plugins
JARS=.:\
$LIBS/org.eclipse.core.contenttype_3.4.100.v20110423-0524.jar:\
$LIBS/org.eclipse.core.jobs_3.5.100.v20110404.jar:\
$LIBS/org.eclipse.core.runtime_3.7.0.v20110110.jar:\
$LIBS/org.eclipse.core.runtime.compatibility.auth_3.2.200.v20110110.jar:\
$LIBS/org.eclipse.equinox.common_3.6.0.v20110523.jar:\
$LIBS/org.eclipse.equinox.app_1.3.100.v20110321.jar:\
$LIBS/org.eclipse.equinox.launcher_1.2.0.v20110502.jar:\
$LIBS/org.eclipse.equinox.preferences_3.4.1.R37x_v20110725.jar:\
$LIBS/org.eclipse.core.variables_3.2.500.v20110928-1503.jar:\
$LIBS/org.eclipse.osgi.services_3.3.0.v20110513.jar:\
$LIBS/org.eclipse.osgi.util_3.2.200.v20110110:\
$LIBS/org.eclipse.osgi_3.7.2.v20120110-1415
java -cp $JARS org.eclipse.core.launcher.Main -application headlessHello2_1.0.0.201210101509.jar
ADDED
Based on Paul's answer, I copied the config.ini file to the directory where the plugin is exported.
I also modified the script to make the -application
points to the correct id.
R2_HOME=.
LIBS=plugins
JARS=.:\
$LIBS/org.eclipse.core.contenttype_3.4.100.v20110423-0524.jar:\
...
$LIBS/org.eclipse.osgi_3.7.2.v20120110-1415:\
headlessHello2_1.0.0.201210101509.jar
java -cp $JARS org.eclipse.core.launcher.Main -application headlessHello2.id2
Running this script gives me some more files in configuration
directory, but I still have another error message.
org.osgi.framework.BundleException: The activator headlesshello2.Activator for bundle headlessHello2 is invalid
at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:171)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:679)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
What might be wrong?