Monday, May 31, 2010

Eclipse console!

Recently while I was working on some eclipse plugin project,i came to know about a couple of commands and features of eclipse which helped me in fixing the problem in matter of 15 min, before which I have spent a couple of hours trying to find my way through the famous "Jar hell" problem.

The first thing that I came to know of is about an eclipse console! Where you can issue commands to eclipse for querying the status of any loaded plugin, logging done by eclipse itself during its run, etc.

Okay now how do we open the eclipse console? 

Simple, pass the command line options "console" to the eclipse executable. Open a command prompt, navigate to the eclipse folder and issue the following command

eclipse -console

Now you can see a new command prompt like window opened along with the eclipse splash screen with a "osgi>" prompt and cursor!!

Next command line option is "consolelog", start eclipse with this option and you can see the logging done by the eclipse plugins if any. Most of the times this will show you any stack traces of any errors which might occur with out your knowledge. 

You can sepcify both -console and -consolelog to get both the console along with logging. 

Next command line option is "clean", start eclipse with this option to start the eclipse by clearing all the temprary information that was saved by all the plugins. This will prevent any issues/errors caused due to the temporary cache that was being maintained by the eclipse plugins.

Let us look at a couple of commands which you can issue in the eclipse console itself.
First command is "ss" which stands for "short status". This command will print a lot of information about all the plugins that were present in the current installation along with their status if they were resolved or not.

Next command "packages ". This will print all the references of the where it is found in the classpath along with the version of the jar class. The listing will denote the exact lookup path of the class that eclipse will provide for loading the classes of . This list will help in checking to see if the required class is being loaded from the desired jar.

Next command "bundles ". This will print all the references of the plugins that were providing the package name.

No comments:

Post a Comment