https://github.com/hakdogan/java9-module-system-non-maven
Example of Java 9 module system non-maven
https://github.com/hakdogan/java9-module-system-non-maven
java9 module-system
Last synced: 9 months ago
JSON representation
Example of Java 9 module system non-maven
- Host: GitHub
- URL: https://github.com/hakdogan/java9-module-system-non-maven
- Owner: hakdogan
- Created: 2017-07-18T13:50:35.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-08-31T13:23:30.000Z (over 8 years ago)
- Last Synced: 2025-02-15T01:45:59.469Z (10 months ago)
- Topics: java9, module-system
- Language: Java
- Homepage:
- Size: 4.99 MB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
Awesome Lists containing this project
README
= Example of Java 9 module system non-maven
image:https://travis-ci.org/hakdogan/Java9-module-system-non-maven.svg?branch=master["Build Status", link="https://travis-ci.org/hakdogan/Java9-module-system-non-maven"]
This application simply exemplifies working Module System on Java 9 and it uses some libraries such as ``h2 database`` and ``log4j`` as an example of adding the external library.
== How do I compile?
You should use the ``javac`` command with the following parameters in the root directory of the project to compile the classes.
[source,]
----
javac --module-path mods:lib \
-d mods --module-source-path src \
src/Database/module-info.java \
src/Database/src/com/kodcu/db/ConnDB.java \
src/hakdogan/module-info.java \
src/hakdogan/src/com/kodcu/InfoUser.java \
src/User/module-info.java \
src/User/src/com/kodcu/user/User.java
----
With ``find``, this command can be written shorter.
[source,]
----
javac --module-path mods:lib \
-d mods --module-source-path \
src $(find . -name "*.java")
----
== How do I run?
You should use the ``java`` command with the following parameters in the root directory of the project to run this code.
[source,]
----
java -Dfile.encoding=UTF-8 \
-Dlog4j.configurationFile=src/hakdogan/src/log4j2.properties \
-classpath mods/hakdogan\
:mods/Database\
:mods/User\
:lib/h2-1.4.196.jar\
:lib/log4j-core-2.8.2.jar\
:lib/log4j-api-2.8.2.jar \
com.kodcu.InfoUser
----
image::images/readme.gif[]