Showing posts with label myeclipse. Show all posts
Showing posts with label myeclipse. Show all posts

July 12, 2010

Package becomes unrecognized in Eclipse

Error:
Saving a Java source file in Eclipse causes the errors "[class] cannot be resolved to a type" and "The import org.oasis_open.docs.[whatever] cannot be resolved" for classes in a package that was previously recognized.

Solution:
Open the context menu for the affected package in Package Explorer, select Build Path > Configure Build Path... and go to the "Order and Export" tab. Make sure custom classes are at the top, third-party files are in the middle and the JRE is at the bottom of the list. Select OK and refresh the affected files/packages.

April 13, 2010

Show/hide .classpath and other files in Eclipse Package Explorer

Click on the down arrow icon at the top of the toolbar, and open the Filters menu.

March 16, 2010

Generating Javadoc using MyEclipse

It seems that some versions of MyEclipse don't have the "Generate Javadoc..." option under the main Project menu that "regular" Eclipse does, at least MyEclipse 7.5. The facility for generating Javadoc is still somewhere; one workaround way to access it is by opening the help menu, searching for "javadoc" and opening the second result, "Javadoc Generation." That help file has a link to the Javadoc Generation wizard.

March 8, 2010

Setting Eclipse diff tool to ignore whitespace

Open Window > Preferences from the menu bar
Select General > Compare/Patch in the left-side tree menu
Check "Ignore white space"
Press Apply, then OK

(from http://masa-paris.spaces.live.com/Blog/cns!F61AACB5DACD22A7!884.entry)

December 16, 2009

Assertions in Java

Turn on assertions with the -ea or -enableassertions command line flag

In Eclipse, right-click on the file to run in Package Explorer, hover on "Run As" (or "Debug As") and select "Run Configurations..." (or "Debug Configurations..."). Then, select the "Arguments" tab and add the flag in the "VM arguments" box.

Discussion of assertions in production code from Dr. Dobbs