https://github.com/dmhendricks/hn.daniel.helloworld
A simple example of a Java jar library built using Gradle
https://github.com/dmhendricks/hn.daniel.helloworld
gradle-build gradle-example java-example java-library
Last synced: 2 months ago
JSON representation
A simple example of a Java jar library built using Gradle
- Host: GitHub
- URL: https://github.com/dmhendricks/hn.daniel.helloworld
- Owner: dmhendricks
- License: mit
- Created: 2019-06-08T19:52:13.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-06-08T23:36:09.000Z (over 6 years ago)
- Last Synced: 2025-10-11T21:14:15.129Z (3 months ago)
- Topics: gradle-build, gradle-example, java-example, java-library
- Language: Java
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 0
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://www.danhendricks.com/?utm_source=github.com&utm_medium=campaign&utm_content=button&utm_campaign=wordpress-mu-common-toolkit)
[](https://github.com/dmhendricks/hn.daniel.HelloWorld/blob/master/LICENSE)
[](https://m.do.co/t/8a88362f5683?utm_source=github.com&utm_medium=campaign&utm_content=button&utm_campaign=dmhendricks%2Fwordpress-mu-common-toolkit)
[](https://twitter.com/danielhendricks)
# hn.daniel.HelloWorld
A simple example of a jar library built using [Gradle](https://gradle.org/).
## Requirements
- [Oracle Java JDK](https://www.oracle.com/technetwork/java/javase/downloads/) or [OpenJDK](https://openjdk.java.net/install/)
- [Gradle](https://gradle.org/install/)
## Building
The following commands will create: `build/libs/helloworld-0.1.0.jar`
```bash
gradle clean
gradle buildJar
```
## Example Usage
Copy the generated jar file to your project's lib directory.
```java
import hn.daniel.HelloWorld;
...
String helloWorld = HelloWorld.hello();
System.out.println(helloWorld);
String helloDaniel = HelloWorld.hello("Daniel");
System.out.println(helloDaniel);
```
#### Output
```
Hello world!
Hello Daniel!
```
[](https://ga-beacon.appspot.com/?utm_source=github.com&utm_medium=referral&utm_content=button&utm_campaign=dmhendricks%2Fdmhendricks/hn.daniel.HelloWorld)