How to package production archive

Hi,

I downloaded the latest Bakery starter project, and would like to package it into production archive, so that I can run it in command line with “java -jar…” . However, I kept receiving errors in my IDE when trying to package it. Any advice on the steps to do so?

Best regards,
Joey

Hi,

i’m am creating my WAR/JAR with

> mvn clean package -Pproduction

on the command line.

Mark

Thanks a lot.

Hi,

I tried the command in the terminal. However, it kept showing

[ERROR]
 Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project bakery-starter-project
: Compilation failure
[ERROR]
 No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

I already JAVA_HOME to the C:\Java\jdk1.8.0_221. Any advices?

Best regards,
Joey

Did you add JAVA_HOME\bin to PATH? And what is the output of

> javac -version

I suspect maven requires the Java compiler ‘javac’ available on the PATH. So, if the javac call fails try this:

> set PATH=%PATH%;%JAVA_HOME%\bin
> javac -version
> mvn install

Mark

I thought IDE would set the path. It works now. Thanks alot.

Best regards,
Joey