1. A computer implemented method for classpath optimization in a platform independent runtime environment, the computer implemented method comprising: 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; 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; and generating a new classpath environment variable using the identified element.