Hi,
In order to set a marker to a particular line of a file, I have written the following code but the marker doesn't show up.
Code:
IFile = getFirstFileFromProject();//an utility method that gets into the 'src' folder of the project then recursively finds all java files from folders and returns the first file
IMarker marker = null;
try {
marker = file.createMarker(IMarker.PROBLEM);
marker.setAttribute(IMarker.MESSAGE, "My message");
} catch (CoreException e1) {
e1.printStackTrace();
}
I tried to call
Code:
MarkerViewUtil.showMarker(page, marker, true);
but that did not work. Failed with following exception : java.lang.NoClassDefFoundError: org/eclipse/ui/views/markers/MarkerViewUtil despite all the jars present in the classpath and dependencies.
Please guide.
Thanks.