Nextjava
next测试
nextxml
新建项目后,MyEclipse会自动从远程仓库中下载支持包,须要几分钟左右时间。blog
public class HelloWorld {ip
public String say(){it
return "Hello World";class
}test
public static void main(String []args){import
System.out.println(new HelloWorld().say());cli
}
import static org.junit.Assert.*;
public class HelloWorldTest {
public void testSay(){
HelloWorld helloWorld = new HelloWorld();
String result = helloWorld.say();
assertEquals("Hello World",result);
}
通常不会有什么问题,若是有问题通常是jdk的版本问题,可是我这里也没出什么错误,看到别人网上说的3.1版本以上的Maven须要用1.7版本及以上的jdk,必定要是jdk,不能是jre.
指定jdk
测试:右键pom.xml,
结果:
其余的clean,install,能够本身尝试,都是同样的用。