Its unusual for .net framework 2 to install itself without you instigating it. But it may have been put there by another program installation. Have you installed Visual C# for instance? This will also install framework 2, as will other Microsoft Visual apps.
J2SE runtime is Java. It is needed for certain web sites that use its code. Youc can safely leave both where they are.