How start my application as server from console?

a_subscriber :

In IntellIJ IDEA I start my Kotlin project like server. Here my run config:

enter image description here

Nice. It's start on port 3333.

I use this classes for server

import javax.ws.rs.GET
import javax.ws.rs.Path
import javax.ws.rs.Produces
import javax.ws.rs.QueryParam
import javax.ws.rs.core.MediaType

OK.

But I need to start my application as server from console.

How I can do this?

I try this:

java server config.yml -jar com.myproject.jar

but I get error:

Error: Could not find or load main class server
Ignatiamus :

You have to put your command line arguments after the parameters for the JVM, e.g.

java -jar com.myproject.jar server config.yml

If you need to specify a main class which is located somewhere in your Jar do the following:

java -cp com.myproject.jar com.myproject.AppStarterKt server config.yml

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=160692&siteId=1