The present invention relates generally to data processing systems and relates specifically to displaying classpath and JAR file information in the hover help of a software debugger.
Software developers migrate computer applications from a first environment to a second environment in the normal course of their work. For example, when software developers complete a new computer application, they must migrate the new computer application from a development environment to a work environment where the application can be used by others. In another example, existing applications are migrated from a first environment on an old server or computer running an old operating system to a second environment on new server or a computer running new operating system. Even when a computer application runs properly in a first environment, errors may occur when running the computer application in a second environment.
In order to prevent errors, software developers test, or “debug,” the computer application in the second computer environment to verify that the computer application runs properly in the second environment. To test the computer application in the second environment, software developers use a debugger. Debuggers run each line of code in the computer application in sequence, one line of code at a time, to identify any errors that may occur for each line of code. Debuggers often employ a feature called a help dialog box to assist in the debugging process. A help dialog box contains additional information about an element on a computer display in response to the user performing a predefined action related to the element. For example, a help dialog box may open when a user right clicks on the element, or selects “help” from a menu when the element is highlighted. In another example, “Hover help” is a help dialog box that opens when a user places a mouse cursor over the element. U.S. Patent. App. No. 2005/0114778 A1 discloses hover help for displaying information in response to a mouse cursor positioned over a feature on a computer display. In the context of a debugger, hover help displays information about a line of code when the developer places a mouse cursor over the line of code. A debugger's help dialog box information may describe the usage of a command in the line of code, the types of arguments that can be used with the command, and the types of responses that can be generated by the command.
JAVA is a programming language used by software developers to create computer applications. JAVA computer applications are often made up of several partial computer applications called “Applets.” Each Applet used by a JAVA computer application can be stored and run from separate physical or logical locations. For example, an Applet on a server computer and an Applet on a client computer can run together as part of a single JAVA computer application. Because portions of a JAVA computer application can be run on separate computers, the JAVA programming language is particularly well suited for internet based computer applications used on the World Wide Web.
In order to run Applets located on different computers together in a single JAVA computer application, the JAVA programming language employs a structure for defining and locating each Applet used by a JAVA computer application. The structure employs “classpaths” and import statements to tell a JAVA compiler where to locate Applets used by a JAVA computer application. A classpath is a JAVA environment variable that tells a JAVA compiler where to find one or more “class files.” A “class file” is a complied JAVA source code for a JAVA computer application or Applet, using a precisely defined file format. Class files are stored in a “JAR file” (JAR is an abbreviation of “JAVA Archive”) bundled with associated auxiliary resources containing everything needed for a single JAVA computer application or Applet to run. JAVA compilers use an “import statement” to locate related resources and class files using a fully qualified class name. Alternatively, software developers can define a set of import statements to list each individual resource and class file related to a common classpath. Software developers must be careful to ensure that the classpath and import statements are correct, or else the JAVA computer application will not be able to locate JAR files containing the class files for the Applets that make up the JAVA computer application.
When migrating JAVA computer applications from a first environment to a second environment, software developers encounter three common errors. Either a classpath is not set up properly for the second environment, contents are missing from a required JAR file, or a required JAR file is missing. With any of these errors, the JAVA computer application cannot locate the required JAR file or JAR file contents. If the classpath is not set up correctly, the JAVA compiler will not look for class files in the correct location. If some of contents of the required JAR file are missing, such as an instruction set or resource, the JAVA compiler will not be able to locate or run the required JAR file contents. If the required JAR file containing the class file was not copied to the second environment, or if the required JAR file was not copied to the proper directory in the second environment, then the JAVA compiler will not be able to locate the required JAR file. Current debuggers can identify a line of code where a required JAR file is not found, but current debuggers cannot tell the software developer where the required JAR file should be located because current debuggers do not display the classpath associated with the line of code.
Currently, to find a missing JAR file, a software developer must rigorously search each JAR file in the first environment to see which JAR file contains the line of code causing the error. The developer can then ensure that the required JAR file has been copied to the correct directory in the second environment. Once the developer knows where the required JAR file should be located, the developer can ensure that the classpath is correct. A need exists for a method to obtain the classpath for a selected line of code from the JAVA compiler and display the current classpath when using a JAVA debugger. (The classpath is identified by the JAVA compiler as part of the compiling process prior to debugging the JAVA computer application.) Additionally, the method should display the name and location of the JAR file containing the line of code. If a software debugger displays the classpath and the name and the location of the JAR file for a line of code, developers can quickly identify and correct the exact problem when the JAVA computer application works in a first environment but not in a second environment.
A “Classpath Identifier” displays a current classpath for a line of code in a computer application as part of a help dialog box in a software debugger program. Responsive to the help dialog box activating for the line of code, the Classpath Identifier obtains from a compiler the classpath associated with the line of code and displays the classpath in the help dialog box. Additionally, the Classpath Identifier displays the name and the location of a JAR file containing the line of code.
The novel features believed characteristic of the invention are set forth in the appended claims. The invention itself, however, as well as a preferred mode of use, further objectives and advantages thereof, will be understood best by reference to the following detailed description of an illustrative embodiment when read in conjunction with the accompanying drawings, wherein:
The principles of the present invention are applicable to a variety of computer hardware and software configurations. The term “computer hardware” or “hardware,” as used herein, refers to any machine or apparatus that is capable of accepting, performing logic operations on, storing, or displaying data, and includes without limitation processors and memory. The term “computer software” or “software,” refers to any set of instructions operable to cause computer hardware to perform an operation. A “computer,” as that term is used herein, includes without limitation any useful combination of hardware and software, and a “computer program” or “program” includes without limitation any software operable to cause computer hardware to accept, perform logic operations on, store, or display data. A computer program may, and often is, comprised of a plurality of smaller programming units, including without limitation subroutines, modules, functions, methods, and procedures. Thus, the functions of the present invention may be distributed among a plurality of computers and computer programs. The invention is described best, though, as a single computer program that configures and enables one or more general-purpose computers to implement the novel aspects of the invention. For illustrative purposes, the inventive computer program will be referred to as the “Classpath Identifier”
Additionally, the Classpath Identifier is described below with reference to an exemplary network of hardware devices, as depicted in
Classpath Identifier 200 typically is stored in a memory, represented schematically as memory 220 in
Hover help plug-in 300, shown in
A preferred form of the invention has been shown in the drawings and described above, but variations in the preferred form will be apparent to those skilled in the art. One skilled in the art will see that the Classpath Identifier can be applied to the migration of many different types of applications from a first environment to a second environment. In addition to JAVA applets, the Classpath Identifier can by used with servlets, weblets, and non-JAVA based applications and sub-applications. Further, Classpath Identifier can be used with any help dialog box implementation known in the art, not just hover help. The preceding description is for illustration purposes only, and the invention should not be construed as limited to the specific form shown and described. The scope of the invention should be limited only by the language of the following claims.