While discussing another question I asked, @Aaron Digulla pointed out the following:
If you installed the Java SDK, there should be a \"src.zip\" file
a) Eclipse comes with it's own Java compiler, so if you are using the Java Runtime Environment, you won't run into many issues, except that extras like jarsigner and possibly the JRE source code may be missing. The best way to verify your installation is through your package manager; however, if you installed by some other means, careful directory observation can usually differentiate the two (see below).
b) JRE libraries are typically compiled without debugging symbols present. SDK libraries typically have them. Java debugging is done by starting the JVM with command line options which open a debugging port. The SDK talks to the JVM requesting breakpoints be set through this port. Later if you decide to step the JVM, it also sends the step / jump / rewind debugging commands through this port. The "debugging" symbols are actually JVM bytecode tables, which reference which line of source code is in effect starting at a particular bytecode instruction. This allows debuggers to associate the running bytecodes with line numbers in the original source code.
c) Verify it by (from the menu) Window->Preferences (on the selector column) expand "Java", expand "Build Path" under "Java", and select "ClassPath variables". You will see a few variables, including one called "JRE_SRC", which should point to the src.zip file containing the public facing JRE library source code. It is a good idea to verify JRE_LIB at the same time.
A JDK home directory typically contains a "bin" sub-directory and a "jre" sub-directory, so if you only see a "bin" sub-directory, odds are good you are in a JRE home directory. With this knowledge, hopefully you'll be able to figure the rest out.
Go to the preferences (Window -> Preferences) and type "JRE" in the search field.
Select "Installed JREs". Make sure that the Java Runtime uses the version of Java which you expect.
If it does, select it, click "Edit". The icon for "rt.jar" should have a little text symbol on top of it (it should look different than the dnsns.jar, for example).
If it doesn't, click "Restore Defaults". If that doesn't work, double check the path.
This should also solve your other problems.
To check whether a class contains debug symbols, decompile it with javap -v
(see this question: Check if Java bytecode contains debug symbols)
Some Java implementations allow to ignore debug symbols as classes are loaded. This can cause "Unknown Source" for classes which contain symbols. I was sure that there was such an option for Sun's Java but I can't find it anymore.