Do you mean the Java SDK or Java JRE is installed?
What you may be looking for is tools.jar . Unless it is in you class path, you won't know the difference.
try {
Class.forName("sun.tools.javac.Main");
System.out.println("We have tools.jar in our path");
} catch (ClassNotFoundException e) {
System.out.println("The jar tools.jar not found");
}
Another option is to look at System.out.println(System.getProperties().list());
to see if this has want you looking for.
Run the follwoing code then you will find the files installed
import java.net.InetAddress;
class classpath {
public static void main(String args[]) {
System.out.println("List of all Classes in the class path");
Object clspath = System.getProperties();
System.out.println(clspath.toString());
System.out.println("List of all Classes in the class path" + "\n");
System.out.println(System.getProperty("java.class.path"));
}
}