1. A method for classpath environmental variable optimization in a platform independent runtime environment, the method comprising the steps of: a computer identifying a required class in an import statement in source code for a software program, wherein the required class is required by the software program; the computer identifying an element containing the required class in a classpath environment variable to form an identified element, wherein the element includes at least one of a directory and an archive file; the computer generating a new classpath environment variable using the identified element; the computer storing the new classpath environment variable in a classpath file, wherein the classpath file has a name of the software program and a classpath extension; responsive to a received command to invoke the software program, the computer determining if a classpath file with a name of the software program and a .classpath extension is present; and if the classpath file with a name of the software program and a .classpath extension is present, the computer invoking the software program using the classpath file having the new classpath environment variable stored therein.