Eclipse Java Pearls

If you’ve been around academic M.D.s you know about “Clinical Pearls of Knowledge.”  In essence, a Pearl is really just a tid-bit of knowledge that may be anecdotal but is probably worth sharing.   For the past 4 years I’ve been programming JAVA HIT tools using the Eclipse IDE and there are a few “Pearls” I’ve learned along the way

  1. Spend less than a hour reading through the Eclipse documentation for your programming language of interest (see: ref link).  It amazes me how often fellow programmers arrogantly ignore their most important tool’s documentation.  Reading through this documentation will not only familiarize you with the Eclipse platform, but also give you some context into what the Eclipse foundation considers good programming work-flow.
  2. If you want to see an identical file structure to your HDD’s file structure (e.g. view .class files in Eclipse) within Eclipse use the “Navigator” View and not the “Package Explorer” View.  Both can be accessed from the Window–>Show View menus.
  3. Learn and love Maven, and then learn to love m2Eclipse.  Maven helps you establish a best practice file structure for your project, and this in turn makes your development work-flow less cumbersome (called the “development cycle” in Maven speak.  See: Maven Philosophy).  Tasks like compiling, deploying, packaging, testing…are natively included in the Maven architecture.  Best of all, it has good integration with the Eclipse IDE via Sonatype’s m2Eclipse plug-in.
  4. If you’re planning on using tomcat with eclipse, learn how Eclipse deploys your projects (e.g. where your web service files are deployed to) and also what deployment options you have (see http://wiki.eclipse.org/WTP_Tomcat_FAQ for more info).  The only true way to ensure that your deployment file structure matches your project file structure is to compare the file structures after deployment.
  5. Try not to rely on Eclipse’s built-in build scripts (i.e. .classpath & .project files).  It is always tempting to build your project/application solely using Eclipse’s built in tools.  This works, but it makes your project very difficult to modify in another IDE (yes, there are other Java IDEs).  Using Ant is a great solution, but as I mentioned above, Maven seems to be a better solution.
  6. If you are converting an eclipse project into a maven project.  First place all source files under a common “src” folder.  Then right click the src folder and select “make this my source folder.”
  7. If you have more than one monitor, set new perspectives to open in their own window.  If you’re like me, you like the idea of having a single editing environment that persists even when you’re debugging your application.  Going to Window > Preferences > General > Perspectives and selecting the “open a new perspective in a new window” radio button allows for a single editing environment on each monitor.  Eclipse was one of the first IDEs to offer dual-monitor support and perspective managment  is one of the reasons Eclipse continues to be such a great development tool.
  8. More to come.
This entry was posted in Eclipse, Java. Bookmark the permalink.

One Response to Eclipse Java Pearls

  1. Ajohns says:

    This blog is very practical & will help a lot of people. Nice design on the logo.

Leave a Reply

Your email address will not be published. Required fields are marked *