Reputation: 45
Can not get variable value in debug view and eclipse can not stop execution at breakpoint
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);
int TotalCol = SH.getColumns();
int TotalRow = 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();
}
}
}
Upvotes: 1
Views: 689
Reputation:
Andreas has already answered the question, your Problem is cause by a Trigger Point
.
(These are introduced in Eclipse Oxygen)
In your workspace is at least one breakpoint defined as a Trigger Point
(Icon: ), therefore all other breakpoints (Icon: ) are suppressed as long as no Trigger Point
is hit.
Unfortunately you have probably defined somewhere in your workspace a Trigger Point
which is never triggered (or not before the other breakpoints) so eclipse would never stop.
To fix this you can disable all Trigger Points
or remove all breakpoints and only set those which you really need.
Here is a example for a misused Trigger Point
:
As you can see the Breakpoint on line 10 is defined as a Trigger Point
but is in a private method which is never called, therefore the Breakpoint at line 6 will never stop the program.
Now we just disable the faulty Breakpoint at line 10 and eclipse will stop as intended on line 6.
Also read Debugging the Eclipse IDE for Java Developers for the new debugging functions in Eclipse Oxygen.
Upvotes: 5