分类: Java
2015-11-16 14:51:56
- open jdk 7
- sudo apt-get install openjdk-7-jdk
- eclipse()
- eclim()
- java -jar eclim_2.5.0.jar
- gradle(参考)
二、准备
在项目主目录下,创建以下子目录;在*nix系统下可以使用命令:mkdir -p src/main/java/hello
在src/main/java/hello目录中,你可以创建任何Java类。为简单起见创建两个类HelloWorld.java和Greeter.java
- |---src
- | |---main
- | | |---java
- | | | |---hello
src/main/java/hello/HelloWorld.java的源代码
- package hello;
- public class HelloWorld {
- public static void main(String[] args) {
- Greeter greeter = new Greeter();
- System.out.println(greeter.sayHello());
- }
- }
rc/main//hello/Greeter.java的源代码
- package hello;
- public class Greeter {
- public String sayHello() {
- return "Hello world!";
- }
- }
- apply plugin: 'java'
- apply plugin: 'eclipse'
- $ gradle eclipse
三、导入eclipse
- apply plugin: 'java'
- apply plugin: 'eclipse'
- apply plugin: 'application'
- mainClassName = 'HelloWorld'
- /*配置第三方库来源*/
- repositories {
- mavenLocal()
- mavenCentral()
- }
- dependencies {
- testCompile group: 'junit', name: 'junit', version: '3.8.+'
- }