Thursday, May 28, 2009

Eclipse: Could not launch the product...

Eclipse crashed or in my case took too long to open a file and I had to shut it down in a not clean state (really surprised it didn't crash during my attempt AND I didn't have to kill it! Great job people@eclipse!).
Next thing that happens when I try to re-launch it using the same workspace is an error message:

Could not launch the product because the associated workspace is currently in use by another Eclipse application

You need to:
  1. go to the workspace home directory
  2. enter the .metadata directory
  3. remove file .lock
and you can happily restart from where you left your job.

Thursday, May 14, 2009

JUnit, log4j And Eclipse

If you want Eclipse to pick up your log4j configuration file when you run JUnit tests from within Eclipse you can:
  1. Right-click on a test class.
  2. Select Run as --> Run configurations...
  3. Select the Classpath tab
  4. Select the home directory of you project and Advanced
  5. Then Add folder and add the folder with the configuration file and you're done.
This will configure the test file's JUnit run options.

If you want to configure all test classes with the same optoins... uhmm... stay tuned. I'll be back.