Welcome to Aspire Knowledge Central (AKC)
Home Public Library Author Content
eclipse: Eclipse FAQ
Eclipse related
Nuances with rebuilding a project in eclipse
When you copy new files into an eclipse source directory, you may want to do the following
1. Click on the project
2. Do a refresh using F5 or "right-click/refresh"
3. Do a rebuild on the project
To do a rebuild, you may have to turn off the build automatically option and then try rebuild
After rebuilding the project, you may want to turn back the automatic build option again
How to find a file a in package explorer or Navigator?
Often times, the file you have so painstakingly located and opened for edit is a read only file. To make the file writable you have to go to the file either in the navigator or the package exploer (if a java project) and then right click on it to see the properties.
It would be nice to go to the file properties with out going via the navigator.
Sometimes when you right click on the file in the edit window you will see a "show in package explorer". But this depends on which editor is used to open your file. If your file is opened using a text editor then you don't have this option.
For those editors that don't allow this option you can use the "menu/navigate/show in navigator". Or use the "alt-shift-w" and pick the option it presents to locate in the navigator
Now you can finally right click and go to properties to turn off the read only option
1. alt-shift-w to locate the file in navigator
2. Go to properties and turn off read only
How to structure a java project
The following directory structure is recommended
your-root
src
dependent-jars
jar-gen
bin
"src" contains the java packages and source files.
"dependent-jars" contain any third party dependent jar files for compilation
"jar-gen" contains the description files for exporting your source and class files as jar files
"bin" is where you can allow eclipse to drop the binaries.
How to set the tab settings for the java editor
I want to replace tabs with empty spaces as I enter.
How come I don't see errors in my project explorer?
If I go to a java source file, I see that there are errors marked in that source files. But I don't see them propagating to the parent nodes. I have seen this behavior in websphere eclipse. Not sure if this is true with the native eclipse as well
The reason for this is you may be in a non java perspective while you were looking at the java file. For example I was in a server perspective. When I switched to the java perspective I can see the propagating errors.
How can I use eclipse with CVS?
Here is a link that has some notes on cvs
. You may also want to check out the O'Reilly's eclipse cookbook.
The above link is especially useful for figuring out the issues with cvsnt and eclipse, especially the version compatibility.
WSAD 5.1 Web project from clearcase "location is in use" error
See the full story here
wsad, which is based on eclipse, trips up when target directoy contains already a webapp. Right thing to do is to create webapp project first via wsad and then copy your stuff there.
Where can I find plugins for eclipse?
What is the link for finding plugins for eclipse?
Is there an XSLT plugin for Eclipse?
Is there an XSLT plugin for Eclipse?
How can I change the JDK compliance level?
topmenu/window/preferences/java/compiler/compliance and classfiles/Compilercompliance level
Importing an existing project into an eclipse workspace
Your projects can stay inside a workspace or outside a workspace. Either way your project root directory contains all the details needed to work in that project from any workspace.
When you import from a local file system into a workspace, you are directly working on that filesystem directory. No files will be copied to the workspace. It is more like establishing a link or a shortcut in your workspace.
How to do this kind of import
1. File
2. Import ..
3. Existing project into workspace
How to create a new workspace in eclipse quickly?
In eclipse a workspace is a collection of projects. If you want to separate your projects based on a classification scheme, you can do so by creating new workspaces.
It is extreemely simple to create a new workspace for eclipse. Follow the following steps
1. Create a new directory for your workspace
2. Copy the eclipse shortcut
3. Rename the short cut to your preference
4. To the shortcut specify your dir as a -data option
Example
eclipse.exe -data c:\your-dir
3.1rc workspace differences
It is using the windows profile space as the workspace. Previously this was the eclipse home directory. A good reason to specify your own work space.
How can I see my derived classes?
Highlight the interface or classname
right click
Open type hierarchy
How to attach source to a jar file in eclipse for debugging purposes
Sometimes you may want to debug into external jar files. You may have acquired the sources for the jar file separately from the binary jar. In such cases you can use the following process to indicate the sources to eclipse so that at debugging time you can step into the source files.
Look for the jar that you have source for in the "Referenced Libraries" underneath your project in the project explorer. Expand "Referenced Libraries" by opening the plus sign.
Click on the jar file and right click for properties. You will see an option called "Java Source Attachment". Specify the path or the jar file of the source here.
These steps may vary depending on the eclipse release. However bottomline is that you can attach source to an existing jar.
Occasionally though the source options for a jar are turned off as the jar file is indicated as immutable system library. In such cases you may want to drop or remove the jar file and that library and explicitly add it as a user library as if you are attaching that jar yourself and then proceed to attach source code to it.
Hope this helps.