Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 371101 - Documentation for starting the Equinox console is wrong
Summary: Documentation for starting the Equinox console is wrong
Status: CLOSED WONTFIX
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Framework (show other bugs)
Version: 3.8.0 Juno   Edit
Hardware: PC Windows 7
: P3 critical with 3 votes (vote)
Target Milestone: ---   Edit
Assignee: equinox.framework-inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-09 11:16 EST by Zoltán Tóth CLA
Modified: 2023-01-03 06:37 EST (History)
14 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zoltán Tóth CLA 2012-02-09 11:16:49 EST
Build Identifier: 3.8.0. v20111025-1330 and upper

I was trying to start equinox console (3.8.0 M5 release) both with x86 and x64 jdk 7 on windows 7 x64, but it did not start.

Then I tried all of the 3.8.0 releases. M1 and M2 runned properly, I saw the "osgi>" prompt, but with M3, M4, M5 nothing happened.




Reproducible: Always

Steps to Reproduce:
C:\>java -jar org.eclipse.osgi_3.8.0.v20111025-1330.jar -console
Comment 1 Lazar Kirchev CLA 2012-02-09 11:29:09 EST
From M4 Equinox has a new console, for which you need also the bundles org.eclipse.equinox.console.jar
org.apache.felix.gogo.shell.jar
org.apache.felix.gogo.command.jar
org.apache.felix.gogo.runtime.jar

All of these are part of Equinox SDK.

On the other hand, if you want the old-fashion built-in console, you should run Equinox with the property osgi.console.enable.builtin=true
Comment 2 Zoltán Tóth CLA 2012-02-09 11:46:16 EST
(In reply to comment #1)
> From M4 Equinox has a new console, for which you need also the bundles
> org.eclipse.equinox.console.jar
> org.apache.felix.gogo.shell.jar
> org.apache.felix.gogo.command.jar
> org.apache.felix.gogo.runtime.jar
> 
> All of these are part of Equinox SDK.
> 
> On the other hand, if you want the old-fashion built-in console, you should run
> Equinox with the property osgi.console.enable.builtin=true

So in Eclipse I also  need to add these jar-s to User Librarier or in simple windows console I have to add them to the classpath right?
Comment 3 Lazar Kirchev CLA 2012-02-13 03:21:14 EST
(In reply to comment #2)
> (In reply to comment #1)
> > From M4 Equinox has a new console, for which you need also the bundles
> > org.eclipse.equinox.console.jar
> > org.apache.felix.gogo.shell.jar
> > org.apache.felix.gogo.command.jar
> > org.apache.felix.gogo.runtime.jar
> > 
> > All of these are part of Equinox SDK.
> > 
> > On the other hand, if you want the old-fashion built-in console, you should run
> > Equinox with the property osgi.console.enable.builtin=true
> 
> So in Eclipse I also  need to add these jar-s to User Librarier or in simple
> windows console I have to add them to the classpath right?

In Eclipse you don't have to do anything - the shell bundles come with Eclipse. 
When running only Equinox jar you have to describe them either in a config.ini file, as values for the property osgi.bundles, or if you don't want to use config.ini, you can pass them with -Dosgi.bundles=... to java.

Here is a simple example - if you place the shell bundles and equinox in one and the same folder, you should use osgi.bundles=./org.apache.felix.gogo.runtime.jar@start,
./org.apache.felix.gogo.command.jar@start,./org.apache.felix.gogo.shelljar@start,./org.eclipse.equinox.console.jar@start
You can pass osgi.console.enable.builtin=true either in config.ini, or as a system property with -D.
Comment 4 Kfir Ozer CLA 2012-08-21 04:18:50 EDT
i get that exact error message. that's looking into that bug report.
Comment 5 Lazar Kirchev CLA 2012-08-27 01:57:27 EDT
(In reply to comment #4)
> i get that exact error message. that's looking into that bug report.

What error do you get?
Comment 6 Kfir Ozer CLA 2012-08-27 05:32:54 EDT
I have the following error message:
org.osgi.framework.BundleException: Could not find bundle: org.eclipse.equinox.console

when I try to execute osgi from console.
i downloaded the full osgi bundle and when I try to execute it with 

java -jar org.eclipse.osgi_3.8.0.v20120529-1548.jar -console -consoleLog

I still get that error.

even when I try to add the console jar to the execution with:

java -jar org.eclipse.osgi_3.8.0.v20120529-1548.jar -cp org.eclipse.equinox.console_1.0.0.v20120522-1841.jar -console -consoleLog

I still get the same error message.

how can I properly execute the osgi console? 

again.. I'm running it from the full sdk, not from the eclipse package.
Comment 7 Lazar Kirchev CLA 2012-08-28 01:42:24 EDT
(In reply to comment #6)


Ok, but still you start only the Equinox bundle. You should configure the four console bundles I mention in a previous comment also to start along with the Equinox bundle. This is the cause of the error.
Comment 8 Stephan Herrmann CLA 2012-12-04 18:22:14 EST
It seems Equinox should update its front page at http://www.eclipse.org/equinox/documents/quickstart-framework.php which still says:

"... Once you have the Equinox framework JAR, use the following command line:

  java -jar org.eclipse.osgi_3.2.0.jar -console
"

This is no help for users of 3.8+
Comment 9 Friederike Schertel CLA 2013-09-06 03:13:32 EDT
I totally agree with Stephan Herrmann, the documentation is very irritating on this. I am new to OSGI and equinox and I ran into the exact problem yesterday and it took me a while to figure out that I need more plugins than just the org.eclipse.osgi_*.

It would be good to update the documentation for 3.8+ here:
http://eclipse.org/equinox/documents/quickstart-framework.php
Comment 10 mathew CLA 2014-03-25 10:44:14 EDT
Same problem here. Tried following the documentation, got no output from the console. Tried Java 1.7 in case it was a Java 1.8 problem, still got no output.

The fact that the documentation is wrong is bad enough, but the download pages actually encourage users to download just the framework as org.eclipse.osgi_3.9.1.v20140110-1610.jar -- see
http://download.eclipse.org/equinox/drops/R-KeplerSR2-201402211700/index.php

Looks like the minimal fix would be to make the "Getting started" page give the correct incantation:

 java -Dosgi.console.enable.builtin=true -jar org.eclipse.osgi_3.9.1.v20140110-1610.jar -console
Comment 11 Abhinav Atul CLA 2014-04-08 10:51:59 EDT
(In reply to mathew from comment #10)

>  java -Dosgi.console.enable.builtin=true -jar
> org.eclipse.osgi_3.9.1.v20140110-1610.jar -console

@mathew, 
java -Dosgi.console.enable.builtin=true  -jar org.eclipse.osgi_3.10.0.v20140305-1523.jar -console

does not help, below are the logs

!SESSION 2014-04-08 20:10:25.734 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.7.0_51
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_IN
Command-line arguments:  -console

!ENTRY org.eclipse.osgi 4 0 2014-04-08 20:10:26.601
!MESSAGE Could not find bundle: unknown
!STACK 0
org.osgi.framework.BundleException: Could not find bundle: unknown
	at org.eclipse.core.runtime.internal.adaptor.ConsoleManager.checkForConsoleBundle(ConsoleManager.java:58)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:329)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:228)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.main(EclipseStarter.java:205)

!ENTRY org.eclipse.osgi 4 0 2014-04-08 20:10:26.625
!MESSAGE Application error
!STACK 1
java.lang.IllegalStateException: Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini).
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:77)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:378)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:232)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.main(EclipseStarter.java:205)
Comment 12 Tarun Elankath CLA 2015-12-22 00:42:35 EST
I confirm the finding of the last commenter that -Dosgi.console.enable.builtin=true does *not* work. Looks like backward compatability has been broken for a while now, but no-one really cares. _shrugs_
Comment 13 Matteo Palmieri CLA 2016-02-12 17:14:10 EST
As of February 2016 the issue described is still present. Someone approaching eclipse equinox and wanting to learn still gets mislead by inaccurate instructions provided at this link: http://www.eclipse.org/equinox/documents/quickstart-framework.php. I'm unable to run equinox console from command line. The remaining option is to run from Eclipse PDE (not command line)
Comment 14 Paul Verest CLA 2016-04-10 09:43:38 EDT
Answer to stackover question http://stackoverflow.com/questions/25733843/how-to-start-osgi-console/35922571#35922571 suggests a solution
Comment 15 Frederic Fays CLA 2019-01-21 06:06:51 EST
Workaround, tested with an install of Eclipse 2018-12 (Eclipse IDE for RCP and RAP Developers):

Go to the plugin directory

# Unix, bash:
java -Dosgi.bundles=\
$(ls -1 org.apache.felix.gogo.shell_*.jar)@start,\
$(ls -1 org.apache.felix.gogo.command_*.jar)@start,\
$(ls -1 org.apache.felix.gogo.runtime_*.jar)@start,\
$(ls -1 org.eclipse.equinox.console_*.jar)@start\
 -jar $(ls -1 org.eclipse.osgi_*.jar) -console


# Windows, powershell (works in console mode only):
java ('-Dosgi.bundles='+((`
"$(ls org.apache.felix.gogo.shell_*.jar | select -ExpandProperty Name)`@start",`
"$(ls org.apache.felix.gogo.command_*.jar | select -ExpandProperty Name)`@start",`
"$(ls org.apache.felix.gogo.runtime_*.jar | select -ExpandProperty Name)`@start",`
"$(ls org.eclipse.equinox.console_*.jar | select -ExpandProperty Name)`@start"`
) -join ',')) '-jar' "$(ls org.eclipse.osgi_*.jar | select -ExpandProperty Name)" '-console'

# Windows, powershell (works with ISE as well):
Start-Process 'java' -ArgumentList `
(('-Dosgi.bundles=',`
"$(ls org.apache.felix.gogo.shell_*.jar | select -ExpandProperty Name)`@start,",`
"$(ls org.apache.felix.gogo.command_*.jar | select -ExpandProperty Name)`@start,",`
"$(ls org.apache.felix.gogo.runtime_*.jar | select -ExpandProperty Name)`@start,",`
"$(ls org.eclipse.equinox.console_*.jar | select -ExpandProperty Name)`@start",`
" -jar $(ls org.eclipse.osgi_*.jar | select -ExpandProperty Name) -console"
) -join '')
Comment 16 Eclipse Genie CLA 2023-01-03 04:43:14 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 17 Stephan Herrmann CLA 2023-01-03 06:37:11 EST
(In reply to Paul Verest from comment #14)
> Answer to stackover question
> http://stackoverflow.com/questions/25733843/how-to-start-osgi-console/
> 35922571#35922571 suggests a solution

Perhaps, for a minimal solution, http://www.eclipse.org/equinox/documents/quickstart-framework.php should link to the solution on SO? But then adopting that change should be close to trivial for anybody with commit rights on Equinox, isn't it?

Still serving the broken documentation with no further comments sends a bad message to the community, IMHO.