From within my Java program I want to determine which .NET Framework is installed on the system. What is the best (and easiest) way to do this?
Answer Thanks scubabbl! It worked to check the directory System.getenv( 'WINDIR' ) + '\\Microsoft.NET\\Framework' for its directories starting with the letter ‘v’.
From what I understand, the actual file structure in c:\windows\Microsoft.Net\Framework has folders with versions of .Net installed. On my computer, I have folders up to v3.5, or c:\windows\Microsoft.Net\Framework\v3.5.
There are lots of issues with this, including security issues though.
The second, and probably better answer would be to check the windows registry.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP
The Version key will have the value you are looking for.
Edit: stackoverflow question regarding reading the registry with java. read/write to Windows Registry using Java
This library http://www.trustice.com/java/jnireg/ will allow you to read the registry.