--- Debugging --- Andrés Gómez Casanova --- 2010-03-07 ---

Debugging

To develop the application, the user interface has to be tested, and it has to be called from a shell, in order to have access to Jline's functionalities. It cannot be executed from Eclipse, because Eclipse does not have a shell.

The development is done with Eclipse, and it compiles automatically the sources while the code is written. The .class files are generated in the bin directory, and there, the application can be called. In order to load the application, there are some scripts that load the JVM with the necessary libraries and parameters to execute the application.

Scripts

There are three scripts with different approaches to execute the application. All of them are used for developing and testing purposes. The difference between them is the logging level or debugging feature.

  • Main.sh or Main.bat: This is a script that permits to execute the application with a logging level of warning, so the output is the same that the final user will have.
  • Test.sh or Test.bat: This is a script similar to Main but the logging level is more detailed, with an Debug level output. This creates a lot of data in the standard output, and it should use only when fixing a problem. In addition, assertions are activated, a specific configuration is loaded and the grammar is very simple.
  • Debug.sh or Debung.bat; This permits to debug the application remotely using JPDA. It is necessary to create a remote execution in Eclipse, and then, depending on the debugging type the application or eclipse is executed, and then the other. Take a look at http://www.ibm.com/developerworks/opensource/library/os-eclipse-javadebug/index.html The output in this case is the same that is used in Main.

All those methods call the main method from the class name.angoca.zemucan.main.Main.

Video

Take a look at this video, showing how to debug the application: