How to install JHipster

a ipster installing jHipster

To use JHipster it is required to install some packages first, to be able to run JHipster as a developer. You will require:

  • Java SDK
  • maven (or gradle)
  • node.js
  • npm
  • jhipster itself

Now it is crucial to decide what developer you are. Are you the a Windows, a Mac or Linux user?

Installation foreword

As lazy developer we do not want to mess around with runtime environments. For this we will try to install runtime and build tools to be managed. Linux users know this feature through the package management of their OS.

To avoid any dependency issues, follow the setup instructions steps by step.

Installation of our prerequisites of JHipster

We require a bunch of tools to run JHipster. Install the prerequisites to ensure that JHipster works well.

SDKMAN installation

SDKMAN helps us to manage a bunch of developer tools. So ensure you have installed it already by following the instructions in Install SDKMAN

Now let us install the prerequisites for the Java SDK side.

Java SDK installation

Run following command to get the available versions

sdk list java

in our case we want to use Java.net / open version and the latest 17.x version

sdk install java 17.0.2-open
sdk default java 17.0.2-open

maven installation

now install our required build tool maven. Usually the latest version is okay, anyway we stick to a specific tested version named in the command

sdk install maven 3.8.8
sdk default maven 3.8.8

We prefer to use maven, except there is a reasonable need to use something else.

gradle installation

for the tutorials here we will mostly stick to maven, but for completeness we provide also gradle environment

sdk install gradle

node.js and npm installation

Follow the instructions in Install node.js & npm with NVM

JHipster installation

Install JHipster as global npm package in a specific version in our case v7.8.1

npm install -g generator-jhipster@v7.9.3

JHipster first run

Let us get started with the first JHipster application.

Navigate to your folder where you save your projects

cd <yourProjectsFolder>

Prepare the jhipster project folder

mkdir sampleJhipsterApp
cd sampleJhipsterApp

Generate the application

jhipster

Now you need to define a bunch of settings

Which *type* of application would you like to create? (Use arrow keys)

we use for now

Monolithic application (recommended for simple projects) 

and

What is the base name of your application? (sampleJhipsterApp)

hit return to accept

Do you want to make it reactive with Spring WebFlux? (y/N)

hit return to use No

What is your default Java package name? (com.mycompany.myapp)

we change this to

com.xenovation.samplejhipsterapp

and

Which *type* of authentication would you like to use? (Use arrow keys)

use

JWT authentication (stateless, with a token)
Which *type* of database would you like to use? (Use arrow keys)

use

SQL (H2, PostgreSQL, MySQL, MariaDB, Oracle, MSSQL)

and

Which *production* database would you like to use? (Use arrow keys)

we use typically

PostgreSQL

and

Which *development* database would you like to use? (Use arrow keys)

use

H2 with disk-based persistence

and

Which cache do you want to use? (Spring cache abstraction) (Use arrow keys)

use

Ehcache (local cache, for a single node) 

and

Do you want to use Hibernate 2nd level cache? (Y/n)

hit return for yes

Would you like to use Maven or Gradle for building the backend? (Use arrow keys)

use

Maven

and

Do you want to use the JHipster Registry to configure, monitor and scale your application?

select yes

Yes

and

Which other technologies would you like to use? (Press <space> to select, <a> to toggle all, <i> to invert selection, 
and <enter> to proceed)

we use these 3 selections (ensure you select them both with space)

Apache Kafka as asynchronous messages broker
API first development using OpenAPI-generator

and

Which *Framework* would you like to use for the client? (Use arrow keys)

we require

Angular

and

Do you want to generate the admin UI? (Y/n)

we hit return to say yes

Would you like to use a Bootswatch theme (https://bootswatch.com/)? (Use arrow keys)

use

Cyborg

and

Choose a Bootswatch variant navbar theme (https://bootswatch.com/)? (Use arrow keys)

use

Primary

and

Would you like to enable internationalization support? (Y/n)

hit return to say yes

Please choose the native language of the application (Use arrow keys)

we select English

Please choose additional languages to install

we select German

German

and

Besides JUnit and Jest, which testing frameworks would you like to use?

we use cypress for frontend testing and Gatling for later load testing, along with cucumber for BDD tests

Cypress
Gatling
Cucumber

and

Would you like to install other generators from the JHipster Marketplace?

hit return to choose No

Would you like to generate code coverage for Cypress tests? [Experimental] (y/N)

Choose Yes

Would you like to audit Cypress tests? (Y/n)

Select Yes

After a few seconds/minutes your jhipster sample app is generated. But the dependency fetching of npm and maven can take ages. Depending on your network connection. Now it is time to take a short break and to grab a tea or coffee

First steps with you fresh generated app

Hopefully nothing went wrong. If you get an error during the generation, recheck if you have really all named versions running from this tutorial. We regularly face some odd issues, if versions do not match perfectly.

Let run the app

./mvnw

This may run again for a while, depending on your machine. And after finishing it starts a webserver which contains our app typically under


Share:

Facebook
Twitter
Pinterest
LinkedIn

Leave a Comment

Your email address will not be published. Required fields are marked *

Table of Contents

On Key

Related Posts