1

I new to Java and I'm trying to debug a Java code and expecting to stop execution at breakpoint. But I get below message in my debug view:

<terminated>pullData [Java Application] 
    <terminated>Core_java.Excelread at localhost:57966  
    <terminated, exit value: 0>C:\Program Files\Java\jdk1.8.0_144\jre\bin\javaw.exe (25-Nov-2017, 12:04:21 PM)  

Below is my code:

 import java.io.*;
 import jxl.*;

 public class Excelread {

     public static void main(String[] args) throws Throwable {
         String Filename = "C:\\library\\TestData.xls";
         String Sheetname = "Source";
         String[][] arrayExcelData = null;
         FileInputStream fis = new FileInputStream(Filename);
         Workbook WB = Workbook.getWorkbook(fis);
         Sheet SH = WB.getSheet(Sheetname);
●        SH.getColumns();
         SH.getRows();

             /* System.out.println(TotalCol +" "+ TotalRow);
             arrayExcelData = new String [TotalRow][TotalCol];
             for (int i=0; i<TotalRow; i++) {
                 for(int j=0;j<TotalCol;j++) {
                     arrayExcelData[i][j] = SH.getCell(j,i).getContents();
                     System.out.print(arrayExcelData[i][j]+ "\t");
                 }
                 System.out.println();
             }*/
     }
 }
Gerold Broser
  • 14,080
  • 5
  • 48
  • 107
  • How do you invoke the program ? See [here](https://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftasks-debug-launch.htm) – c0der Nov 25 '17 at 08:39

1 Answers1

0

If you set a breakpoint and perform RunRun instead of RunDebug (or via the according toolbar buttons Run instead of Debug) the breakpoint is ignored.

See Help - Eclipse Platform, Launching a Java program in debug mode.

BTW, all uppercase variable names (WB, SH) should be used for final variables, i.e. constants only by convention.

And throwing a Throwable usually doesn't make much sense, since Error is a direct subclass of Throwable and its description reads:

An Error is a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch.

Gerold Broser
  • 14,080
  • 5
  • 48
  • 107
  • Here my intention is to stop execution at breakpoint instead ignoring it. And could any one let me know why my eclipse is not debugging properly and why i'm getting terminated java application error ? – mahesh babu Nov 26 '17 at 06:32
  • @maheshbabu This is not an error message. Look at ["exit value: 0"](https://en.wikipedia.org/wiki/Exit_status#Java). It just tells you that your code ran and ended. If there's an error you'd see an unmissable exception message and stack trace in Eclipse's Console view in red. – Gerold Broser Nov 26 '17 at 09:51
  • @Broser How can i avoid "exit value: 0" message and how can i stop execution of code at breakpoint in debug mode. – mahesh babu Nov 26 '17 at 11:13
  • @maheshbabu Why do you want to avoid this message? It doesn't hurt, does it? On the contrary: it tells you that your code ended normally. I'm not aware of any way to suppress this msg in the Console view but to develop an own Console view – a fruitless task, IMHO. Is the breakpoint disabled (is the marker to the left blue or white)? Right-click on the marker and check its state. If you don't achieve progress please supply a screenshot of the Debug view. – Gerold Broser Nov 26 '17 at 12:15