I often find myself struggling, after not working with java for many moons, on how to start a simple project. I am so spoiled after working with node.js for so long :)
To use this, start by cloning this project to your machine.
The build scripts are built around gradle. You can install gradle or use the provided version (gradle wrapper).
To install using brew, run brew install gradle
.
To install manually, goto gradle.
To use the provided version, instead of running gradle
, run ./gradlew
If you use Eclipse, the gradle scripts are nice enough to create your project and classpath files.
The first time you open the project, first create the eclipse project files:
gradle eclipse
Now you can import the project into eclipse.
If you change dependencies, update the classpath:
gradle cleanEclipseClasspath eclipseClasspath
To use Idea with this project, do one of the following
Opening Idea, start new project, and import using the build.gradle
file
Run the following command to setup the idea project
gradle cleanIdea idea
To compile:
gradle fatjar
java -cp build/libs/jar-starterkit.jar jayray.net.hello.HelloWorld
To compile:
gradle installApp
build/install/jar-starterkit/bin/jar-starterkit