java - Unable to start OSGI framework on eclipse or after converting to jar -
iam developing osgi equinox launcher should start osgi framework , equinox console.i have added 5 jars in folder called plugin part of classpath/buildpath still iam unable execute.
below command executes on linux console , opens osgi> prompt on linux console.
java-dosgi.bundles=org.eclipse.equinox.console_1.1.0.v20140131-1639.jar.@start,org.apache.felix.gogo.command_0.10.0.v201209301215.jar@start,org.apache.felix.gogo.runtime_0.10.0.v201209301036.jar@start,org.apache.felix.gogo.shell_0.10.0.v201212101605.jar@start -jar org.eclipse.osgi_3.10.0.v20140606-1445.jar -console
but above fails in code below
public static void main(string[] args) {
string command ="java-dosgi.bundles=plugin/org.eclipse.equinox.console_1.1.0.v20140131-1639.jar@start,plugin/org.apache.felix.gogo.command_0.10.0.v201209301215.jar@start,plugin/org.apache.felix.gogo.runtime_0.10.0.v201209301036.jar@start,plugin/org.apache.felix.gogo.shell_0.10.0.v201212101605.jar@start -jar plugin/org.eclipse.osgi_3.10.1.v20140909-1633.jar -console";
try { // using runtime exec method: process p = runtime.getruntime().exec(command); bufferedreader stdinput = new bufferedreader(new inputstreamreader(p.getinputstream())); bufferedreader stderror = new bufferedreader(new inputstreamreader(p.geterrorstream())); // read output command system.out.println("here standard output of command:\n"); while ((s = stdinput.readline()) != null) { system.out.println(s); } // read errors attempted command system.out.println("here standard error of command (if any):\n"); while ((s = stderror.readline()) != null) { system.out.println(s); } system.exit(0); } catch (ioexception e) { system.out.println("exception happened - here's know: "); e.printstacktrace(); system.exit(-1); } }
the error below here standard output of command:
here standard error of command (if any):
error: unable access jarfile plugin/org.eclipse.osgi_3.10.1.v20140909-1633.jar
the 2 commands (the 1 executing on linix console , 1 fails in code) different. in first 1 use
-jar org.eclipse.osgi_3.10.0.v20140606-1445.jar
while in second
-jar plugin/org.eclipse.osgi_3.10.1.v20140909-1633.jar
since error message says cannot access plugin/org.eclipse.osgi_3.10.1.v20140909-1633.jar
assume jar file not exist why command failing.
Comments
Post a Comment