Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run project with java options via sbt

Tags:

scala

sbt

I am running my fat jar with command java -Djava.security.krb5.conf=/krb5.conf -jar my.jar.

How to run my app with this option via sbt?
$ sbt -Djava.security.krb5.conf="module\\src\\main\\resources\\krb5.conf" run doesn't work. Error:

ctl-scala>sbt -Djava.security.krb5.conf="ctl-core\src\main\resources\krb5.conf" ctl-ui-backend/run
Warning: invalid system property 'java.security.krb5.conf'
[info] Loading global plugins from C:\Users\User\.sbt\0.13\plugins
[info] Loading project definition from C:\Users\User\IdeaProjects\ctl-scala\project
[info] Set current project to ctl (in build file:/C:/Users/User/IdeaProjects/ctl-scala/)
[error] No valid parser available.
[error] ctl-core\\src\\main\\resources\\krb5.conf
[error]             ^

like image 960
Oleg Avatar asked Dec 19 '17 14:12

Oleg


People also ask

Can sbt be used with Java?

sbt is built for Scala and Java projects. It is the build tool of choice for 93.6% of the Scala developers (2019).

Does sbt run compile?

sbt is a popular tool for compiling, running, and testing Scala projects of any size. Using a build tool such as sbt (or Maven/Gradle) becomes essential once you create projects with dependencies or more than one code file.

Does Eclipse support sbt?

In a console, cd to the top-level folder of your existing sbt project, and enter sbt eclipse to generate the Eclipse project files for all projects in your build. Start Eclipse and switch to the Workspace you want to use for your Lagom project. From the File menu, select Import.


1 Answers

Can you try sbt -J-Djava.security.krb5.conf="module/src/main/resources/krb5.conf" run

The -J causes the sbt launcher to pass those as options to the JVM.

like image 124
Levi Ramsey Avatar answered Sep 28 '22 11:09

Levi Ramsey