The preferred way to extract system-dependent information is the system properties of the java.lang.System.getProperty methods and the corresponding getTypeName methods of the Boolean, Integer, and Long primitive types.
The signature of the method getenv is like this - public static String getenv(String name). To get get the value of the specified environment variable we need to pass the name of the variable as parameter. This method is deprecated since 1.3 because of bugs.
java.class.path is used to find directories and JAR archives containing class file.
System.getProperty("java.class.path") includes paths added using the -classpath / -cp JVM argument (defaulting to . if you don't specify any). That does definitely not have to be the same as the environment variable.