How to start class from IntelliJ generated jar?

2019-08-26 07:11发布

问题:

So I build an artifact using intellij. When I try to run class from jar (that is in current folder named cordapp.jar)

java -cp "cordapp.jar" com.template.NodeDriver

It can not find a class.

I extract .jar into a folder, cd into it, run:

java -cp . com.template.NodeDriver 

It starts as expected.

What do I do wrong?