The Artima Developer Community
Sponsored Link

Java Buzz Forum
A Few Eclipse 2.1 Tips

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Scott Stirling

Posts: 54
Nickname: sstirling
Registered: Jan, 2003

Scott Stirling is a Senior Software Engineer at Workscape, Inc.
A Few Eclipse 2.1 Tips Posted: Jul 8, 2003 2:36 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Scott Stirling.
Original Post: A Few Eclipse 2.1 Tips
Feed Title: Blaug Blawg Blog
Feed URL: http://users.rcn.com/scottstirling/rss.xml
Feed Description: Java Testing, Tools and Engineering
Latest Java Buzz Posts
Latest Java Buzz Posts by Scott Stirling
Latest Posts From Blaug Blawg Blog

Advertisement

Copy and Paste class and get automatic package update:

If you select a class in the Java Package Explorer and hit Ctrl+c and then select a package other than the one the class was already in and hit Ctrl+v, Eclipse will create a copy of the class in that package and automatically add/correct the package declaration at the top of the file.

Classpath variables:

Create your own classpath variable in Window->Preferences->Java->Classpath Variables

 Then you can use it to append paths to in a project:

  • goto Project->Properties->Java Build Path->Libraries tab
  • Hit Add Variable... button on the Libraries tab
  • Select a variable from the select box and hit Extend...
  • Navigate to a jar file and hit OK
  • A parameterized path to a jar on the file system is now added to your build path.

This is handy for accessing jars outside of the project in a parameterized way, such as a jar repository like in Maven (which is how I learned this trick). 

It is most useful in a team environment where you're sharing Eclipse .project and .classpath files but you don't necessarily want to hard-code absolute file paths in the .classpath files (so they'll be portable from one machine to another). 

Parameterize the common root path as a new Classpath Variable and then build up the build path by extending the variable as many times as you have jar files and save the project.  The variable is stored as part of the paths in the .classpath file. 

When others import your project (and hence the .classpath) each developer just has to set the value of the particular Classpath Variable (which will show up in the task view with "Missing required library" messages because the jar paths can't be resolved until the variable is defined)  to the full path to the root of the repository on their local machine.

Project Set Files:

Search for them in Eclipse Help.  I tried to get these to work (exporting a set of interlinked projects to a .psf file), and the export did seem to work.  But the import of the .psf (which should load all the interlinked projects in the project set together without importing each one individually) failed -- it just hung Eclipse forever while putting up a dialog box with a progress bar showing no progress.  This would be a great productivity enhancer for me right now, where I'm working with 10 or so related projects that sometimes need to be deleted and re-imported (or Eclipse restarted) because of some change across all of their configurations (change in the .project or .classpath).

I'm using the Rational ClearCase plugin for Eclipse, so sometimes I wonder if a problem like this is in the plugin or in Eclipse.

Read: A Few Eclipse 2.1 Tips

Topic: Nokia US Conference for J2ME Tools? Previous Topic   Next Topic Topic: Nokia-Talks-MoonBuzz

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use