2011-02-24 2 views
0

내 Windows 컴퓨터에서 Texlipse를 Miktex 2.9와 함께 사용하면 문서가 컴파일 될 때마다 시스템에서 NullPointerExcpetion을 발생시킵니다.Texlipse 및 Miktex 2.9가있는 NullPointerException

업데이트 관리자를 사용하여 Miktex 2.9 배포본을 업데이트 한 후에 문제가 사라졌습니다. 이것이 동일한 문제를 가진 사람들을 돕기를 바랍니다. 너무 일이 나에게

감사합니다, Pwndrian

답변

2

.

이것은 해결책 이었지만, 아주 최적의 솔루션이라고 생각하지 않습니다. 열린 버그 http://sourceforge.net/tracker/?func=detail&aid=3306779&group_id=133306&atid=726818이 있다는 것을 알았습니다.

클래스 net.sourceforge.texlipse.builder.TExlipseBuilder이 있으므로이 문제를 극복하기 위해 다음 두 가지 변경 사항을 적용했습니다 (두 기능의 차이점에 유의하십시오). 문제는 getCurrentProject 함수의 TExlipsePlugin에서 actEditor가 null 인 이유는 프로젝트를 가져올 때 활성 편집기가 없거나 편집기가 열려 있지 않은 상태에서 정리를 눌러야하기 때문입니다.

@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(); 
}