<commit_before>== Setup

=== Java 8

Minimal-J is based on Java 8. Even if the new language constructs aren't used much yet
there are some jdk classes which are needed. For example LocalDate.

For information about Java and the download of Java see http://java.oracle.com/ . But be aware that you also need
good Java knowledge to use Minimal-J. It's a good idea to learn java by a specific book
before using Minimal-J. Minimal-J uses Java somehow different than other frameworks. As much
as I like that maybe you should know about how it's used elsewhere before learning
the _minimal_ way.

=== Example

You find the examples on https://github.com/BrunoEberhard/minimal-j/tree/master/example[github]
in the example directory. For an easy starts it's best to grab the empty application and
try the stuff explained here and then fill it with your own ideas.

=== Maven

Minimal-J is built with maven and uploaded to the mvnrepository. If you have installed
maven (see https://maven.apache.org/ ) you can download the needed jar automatically by putting
the dependency in the pom.xml of your project.

----
<dependency>
	<groupId>org.minimalj</groupId>
	<artifactId>minimalj</artifactId>
	<version>0.4.0.1</version>
</dependency>
----

If look in the pom.xml of Minimal-J you see that there are some dependencies to 3rd party
libraries. For example:

----
<dependency>
	<groupId>org.apache.derby</groupId>
	<artifactId>derby</artifactId>
	<version>10.11.1.1</version>
	<scope>compile</scope>
</dependency>
----

The apache derby db is used if you want to store your data only in the JVM memory. Have you
noted the scope _compile_? This means that this dependency is not passed to projects with
a dependency to Minimal-J. If you want to use the in memory feature you have to add the
dependency to your project! On the other side if you don't use the feature you don't have
to bother about anything from derby db.

At the moment there a few dependencies you can copy from den Minimal-J pom.xml. Of course
you can remove the compile scope when doing this.

* Derby DB (with driver)
* The Maria DB JDBC driver
* NanoHttpd (Web UI)
* Lanterna (Terminal UI)

=== Build

You can build your project in the usual maven way

----
mvn clean install
----

=== Start

Then you can start your application with a frontend of your choice. But for some frontend
some preparations must be done. If you want to start a standalone web application your project needs the dependency
to nanohttpd. To deploy on web server a WEB-INF directory with a proper web.xml must be configured. Only the Swing frontend works out of the box.
This is the reason why a like to start with the Swing frontend so much. You don't need a tomcat and/or all the JEE stuff.

You can put together a correct classpath by yourself or you can delegate this to maven
by using the exec plugin

----
mvn exec:java -Dexec.mainClass="org.minimalj.frontend.swing.SwingApplication" -Dexec.args="org.minimalj.example.empty.EmptyApplication"
----

The WebSocket Frontend is started the same way.

----
mvn exec:java -Dexec.mainClass="org.minimalj.frontend.websocket.WebSocketApplicationServer" -Dexec.args="org.minimalj.example.empty.EmptyApplication"
----

Most of the frontends are started like this.
<commit_msg>setup.adoc: updated to 0.6.0.4<commit_after>== Setup

=== Java 8

Minimal-J is based on Java 8. Even if the new language constructs aren't used much yet
there are some jdk classes which are needed. For example LocalDate.

For information about Java and the download of Java see http://java.oracle.com/ . But be aware that you also need
good Java knowledge to use Minimal-J. It's a good idea to learn java by a specific book
before using Minimal-J. Minimal-J uses Java somehow different than other frameworks. As much
as I like that maybe you should know about how it's used elsewhere before learning
the _minimal_ way.

=== Example

You find the examples on https://github.com/BrunoEberhard/minimal-j/tree/master/example[github]
in the example directory. For an easy starts it's best to grab the empty application and
try the stuff explained here and then fill it with your own ideas.

=== Maven

Minimal-J is built with maven and uploaded to the mvnrepository. If you have installed
maven (see https://maven.apache.org/ ) you can download the needed jar automatically by putting
the dependency in the pom.xml of your project.

----
<dependency>
	<groupId>org.minimalj</groupId>
	<artifactId>minimalj</artifactId>
	<version>0.6.0.4</version>
</dependency>
----

If look in the pom.xml of Minimal-J you see that there are some dependencies to 3rd party
libraries. For example:

----
<dependency>
	<groupId>org.apache.derby</groupId>
	<artifactId>derby</artifactId>
	<version>10.11.1.1</version>
	<scope>compile</scope>
</dependency>
----

The apache derby db is used if you want to store your data only in the JVM memory. Have you
noted the scope _compile_? This means that this dependency is not passed to projects with
a dependency to Minimal-J. If you want to use the in memory feature you have to add the
dependency to your project! On the other side if you don't use the feature you don't have
to bother about anything from derby db.

At the moment there a few dependencies you can copy from den Minimal-J pom.xml. Of course
you can remove the compile scope when doing this.

* Derby DB (with driver)
* The Maria DB JDBC driver
* NanoHttpd (Web UI)
* Lanterna (Terminal UI)

=== Build

You can build your project in the usual maven way

----
mvn clean install
----

=== Start

Then you can start your application with a frontend of your choice. But for some frontend
some preparations must be done. If you want to start a standalone web application your project needs the dependency
to nanohttpd. To deploy on web server a WEB-INF directory with a proper web.xml must be configured. Only the Swing frontend works out of the box.
This is the reason why a like to start with the Swing frontend so much. You don't need a tomcat and/or all the JEE stuff.

You can put together a correct classpath by yourself or you can delegate this to maven
by using the exec plugin

----
mvn exec:java -Dexec.mainClass="org.minimalj.frontend.impl.swing.SwingApplication" -Dexec.args="org.minimalj.example.empty.EmptyApplication"
----

The WebSocket Frontend is started the same way.

----
mvn exec:java -Dexec.mainClass="org.minimalj.frontend.impl.nanoserver.NanoHttpdApplication" -Dexec.args="org.minimalj.example.empty.EmptyApplication"
----

Most of the frontends are started like this.

{'fraction_non_alphanumeric': 0.07427258805513016, 'fraction_numerical': 0.004594180704441042, 'mean_word_length': 3.9477272727272728, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, 'pii_count': 5, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1623260', 'n_tokens_mistral': 1920, 'n_tokens_neox': 1812, 'n_words': 927}