Classpath optimization in a Java runtime environment
AssigneeInternational Business Machines Corporation
InventorsJeffry Richard Mausolf, Kimberly Ann Stephens
Life of this patent
Estimating the term…
Abstract
A computer implemented method, data processing system, and computer usable program are provided by the aspects of the present invention. Aspects of the present invention identify required classes of a software program in the import statements in the source code. Next, the aspects of the present invention identify an element in a classpath environment variable that contain only the required classes and generate a new classpath environment variable with the identified element. Aspects of the present invention then store the new classpath environment variable in a classpath file that is specific to the software program for subsequent invocation.
Claims13
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.
A data processing system for classpath environmental variable optimization in a platform independent runtime environment, the data processing system comprising:
- one or more computer-readable tangible storage devices, one or more processors, and one or more computer-readable memories;
- program instructions, stored on at least one of the one or more computer-readable tangible storage devices for execution by at least one of the one or more processors via at least one of the one or more computer-readable memories, to identify a required class in an import statement in source code for a software program, wherein the required class is required by the software program;
- program instructions, stored on at least one of the one or more computer-readable tangible storage devices for execution by at least one of the one or more processors via at least one of the one or more computer-readable memories, to identify 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;
- program instructions, stored on at least one of the one or more computer-readable tangible storage devices for execution by at least one of the one or more processors via at least one of the one or more computer-readable memories, to generate a new classpath environment variable using the identified element;
- program instructions, stored on at least one of the one or more computer-readable tangible storage devices for execution by at least one of the one or more processors via at least one of the one or more computer-readable memories, to store the new classpath environment variable in a classpath file, wherein the classpath file has a name of the software program and a classpath extension and is specific to the software program;
- program instructions, stored on at least one of the one or more computer-readable tangible storage devices for execution by at least one of the one or more processors via at least one of the one or more computer-readable memories, to determine if a classpath file with a name of the software program and a .classpath extension is present responsive to a received command to invoke the software program;
- and
- program instructions, stored on at least one of the one or more computer-readable tangible storage devices for execution by at least one of the one or more processors via at least one of the one or more computer-readable memories, to invoke the software program using the classpath file having the new classpath environment variable stored therein if the classpath file with a name of the software program and a .classpath extension is present.
A computer program product for classpath environmental variable optimization in a platform independent runtime environment, said computer program product comprising:
- one or more computer-readable tangible storage devices;
- program instructions, stored on at least one of the one or more computer-readable tangible storage devices, to identify a required class in an import statement in source code for a software program, wherein the required class is required by the software program;
- program instructions, stored on at least one of the one or more computer-readable tangible storage devices, to identify 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;
- program instructions, stored on at least one of the one or more computer-readable tangible storage devices, to generate a new classpath environment variable using the identified element;
- program instructions, stored on at least one of the one or more computer-readable tangible storage devices, to store the new classpath environment variable in a classpath file, wherein the classpath file has a name of the software program and a classpath extension;
- program instructions, stored on at least one of the one or more computer-readable tangible storage devices, to determine if a classpath file with a name of the software program and a .classpath extension is present responsive to a received command to invoke the software program;
- and
- program instructions, stored on at least one of the one or more computer-readable tangible storage devices, to invoke the software program using the classpath file having the new classpath environment variable stored therein if the classpath file with a name of the software program and a .classpath extension is present.
Dependencies are inferred from the claim text.