Summary
java
file with Vim
Quickrun
2018/10/03 wed
Corrected the class / variable name advised by shiracamus in the comment
Global variable foo_Is pending correction
$ tree
.
└── MyProj // project folder ( working folder )
├── main
│ └── Main.java // entry file
└── myclass
└── Hello.java // your own classes
3 directories, 2 files
Quickrun
\ 'java': {
\ 'exec': ['javac -cp %s:p:h:h:h */*.java', 'java -cp %s:p:h:h:h:%s:p:h %s:t:r %a' ],
\ 'hook/output_encode/encoding': '&termencoding',
\ 'hook/sweep/files': '%S:p:r.class',
\ },
Java's code
entry class
// Main.java
import MyProj.myclass.*;
public class Main {
public static void main(String[] argv){
Hello hello = new Hello("world!");
hello.sayHello();
}
}
your own classes
// Hello.java
package MyProj.myclass;
public class Hello {
private String str_ = "hello ";
public Hello( String s ){
this.str_ = this.str_ + s;
}
public void sayHello(){
System.out.println( this.str_ );
}
}
Reference
I want to import my own class quickrun help
Recommended Posts