2011-12-03 7 views
0

나는 Manning Press에 의해 책 SWT/JFace IN ACTION에서 일하고있다.Eclipse는 JFace에서 메인 클래스를 찾을 수 없습니까?

JFace를 추가하면 Eclipse가 명백하게 존재하지만 어떤 이유로 메인 클래스를 찾을 수 없습니다. 여기

java.lang.NoClassDefFoundError: org/eclipse/core/runtime/IProgressMonitor 
Caused by: java.lang.ClassNotFoundException: org.eclipse.core.runtime.IProgressMonitor 
at java.net.URLClassLoader$1.run(Unknown Source) 
at java.security.AccessController.doPrivileged(Native Method) 
at java.net.URLClassLoader.findClass(Unknown Source) 
at java.lang.ClassLoader.loadClass(Unknown Source) 
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) 
at java.lang.ClassLoader.loadClass(Unknown Source) 
Exception in thread "main" 

답변

1

당신은 JFace의를 사용하여 최소 2 개 단지가 필요합니다

  • org.eclipse.equinox.common
  • org.eclipse.core.commands

자세한 내용은 Using JFace outside the Eclipse platform를 참조하십시오.

+0

굉장 !! 그게 효과가 있었어. 폴 감사합니다! – TangibleDream

0

당신은 필요 ... 여기

Could not find the main class: com.swtjface.ChTwo.HelloSWT_JFace. 
Program will exit. 

예외입니다 ... 제가 이클립스에서 얻을

package com.swtjface.ChTwo; 

import org.eclipse.jface.window.*; 
import org.eclipse.swt.*; 
import org.eclipse.swt.widgets.*; 

public class HelloSWT_JFace extends ApplicationWindow{ 

/** 
* @param args 
*/ 
public HelloSWT_JFace(){ 
    super(null); 
} 
protected Control createContents(Composite parent){ 
    Text helloText = new Text(parent, SWT.CENTER); 
    helloText.setText("Hello SWT and JFace!"); 
    parent.pack(); 
    return parent; 
} 
public static void main(String[] args) { 
    // TODO Auto-generated method stub 
    HelloSWT_JFace awin = new HelloSWT_JFace(); 
    awin.setBlockOnOpen(true); 
    awin.open(); 
    Display.getCurrent().dispose(); 
} 

} 

이 (가) 메시지를 거부 코드입니다 "org.eclipse.core.runtime.IProgressMonitor class"에 jar 파일을 추가하십시오.

확인 this link.

관련 문제