0
當我的Windows機器上使用Texlipse和Miktex 2.9時,系統每次編譯文檔時都拋出一個NullPointerExcpetion。NullPointerException與Texlipse和Miktex 2.9
使用更新管理器更新了Miktex 2.9發行版後,問題消失。希望這可以幫助那些有同樣問題的人。
問候, Pwndrian
當我的Windows機器上使用Texlipse和Miktex 2.9時,系統每次編譯文檔時都拋出一個NullPointerExcpetion。NullPointerException與Texlipse和Miktex 2.9
使用更新管理器更新了Miktex 2.9發行版後,問題消失。希望這可以幫助那些有同樣問題的人。
問候, Pwndrian
對我來說,發生得。
這是我做過的一種解決方法,但我認爲這不是最佳解決方案。 我看到有一個錯誤打開http://sourceforge.net/tracker/?func=detail&aid=3306779&group_id=133306&atid=726818。
有類net.sourceforge.texlipse.builder.TExlipseBuilder
,我做了以下更改以解決此問題(請注意兩個函數的區別)。問題是,在函數getCurrentProject中的TExlipsePlugin中,actEditor爲null,因爲導入項目時沒有活動編輯器,或者在沒有編輯器打開的情況下按下clean按鈕。
@Override
protected IProject[] build(int kind, Map args, IProgressMonitor monitor)
throws CoreException {
BuilderRegistry.clearConsole();
IWorkbenchPage page = TexlipsePlugin.getCurrentWorkbenchPage();
IEditorPart actEditor = null;
if (page.isEditorAreaVisible()
&& page.getActiveEditor() != null) {
actEditor = page.getActiveEditor();
}
if (actEditor == null)
return null;
if (isUpToDate(getProject()))
return null;
Object s = TexlipseProperties.getProjectProperty(getProject(), TexlipseProperties.PARTIAL_BUILD_PROPERTY);
if (s != null) {
partialBuild(monitor);
} else {
buildFile(null, monitor);
}
return null;
}
/**
* Clean the temporary files.
*
* @see IncrementalProjectBuilder.clean
*/
@Override
protected void clean(IProgressMonitor monitor) throws CoreException {
IProject project = getProject();
BuilderRegistry.clearConsole();
IWorkbenchPage page = TexlipsePlugin.getCurrentWorkbenchPage();
IEditorPart actEditor = null;
if (page.isEditorAreaVisible()
&& page.getActiveEditor() != null) {
actEditor = page.getActiveEditor();
}
if (actEditor == null)
return;
// reset session variables
TexlipseProperties.setSessionProperty(project, TexlipseProperties.SESSION_LATEX_RERUN, null);
TexlipseProperties.setSessionProperty(project, TexlipseProperties.SESSION_BIBTEX_RERUN, null);
TexlipseProperties.setSessionProperty(project, TexlipseProperties.BIBFILES_CHANGED, null);
// check main file
String mainFile = TexlipseProperties.getProjectProperty(project, TexlipseProperties.MAINFILE_PROPERTY);
if (mainFile == null || mainFile.length() == 0) {
// main tex file not set -> nothing builded -> nothing to clean
return;
}
cleanTempDir(monitor, project);
cleanOutput(monitor, project);
monitor.subTask(TexlipsePlugin.getResourceString("builderSubTaskCleanMarkers"));
this.deleteMarkers(project);
project.refreshLocal(IProject.DEPTH_INFINITE, monitor);
monitor.done();
}