First, don't worry if you have Java 6 and Java 7 both on your system for now. You can use the command update-alternatives to ensure javac, jdb, jar, etc. etc. are properly linked to their Java 7 versions rather than their Java 6 versions but that is beyond the scope of this post. We are soley focusing on the Java plugin for your web browser and not worried with compiling Java programs, using Java to connecet to databases, etc.

Configuring Java

Do all of this as root.

Assuming you are using a 64bit machine, install the following packages from the repository:

1. openjdk-7-jre - OpenJDK Java runtime, using Hotspot JIT (7u3-2.1.3-1)

This installs into the /usr/lib/jvm/java-7-openjdk-amd64 directory.

*If you are using a 32bit machine you want to instead install the openjdk-7-jre-lib package and when you see amd64 below, use common instead. For example, the 32bit package installs into the /usr/lib/jvm/java-7-openjdk-common directory.

2. icedtea-7-plugin - web browser plugin based on OpenJDK and IcedTea to execute Java applets (1.3.1-2.1)

This installs into the same directory tree as the first install but adds /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/IcedTeaPlugin.so, which is the browser plugin.

Once those are installed, go to the /etc/alternatives directory and create this soft link:

Code:
root@shutupkyle:/etc/alternatives# ln -s /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/IcedTeaPlugin.so > mozilla-javaplugin.so
While still in /etc/alternatives, issue the command ls -la mozilla-javaplugin.so to double check your work. The output should look like this:

Code:
lrwxrwxrwx 1 root root 64 Mar 23 02:30 mozilla-javaplugin.so -> /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/IcedTeaPlugin.so
Now we just need to create the link in the browser plugins directory back to /etc/alternatives/mozilla-javaplugin.so. Go to the /usr/lib/mozilla/plugins directory and create this soft link:

Code:
root@shutupkyle:/usr/lib/mozilla/plugins# ln -s /etc/alternatives/mozilla-javaplugin.so > mozilla-javaplugin.so
While still in /usr/lib/mozilla/plugins, issue the command ls -la mozilla-javaplugin.so to double check your work. The output should look like this:

Code:
lrwxrwxrwx 1 root root 39 Mar 23 02:17 mozilla-javaplugin.so -> /etc/alternatives/mozilla-javaplugin.so
Finally, restart your browser and go to a Java test page to verify it's working.


Configuring Flash

I couldn't explain it any easier than charonsecurity already did.

--

I hope this helps others. It took me hours to get it all straight.