Specify jvm options in a configuration file

Somebody :

I would like to add -Xss40m to a configuration file inside a project itself. I don't want to create the configuration file for a particular IDE, I want it to be inside the project directory itself.

Is it possible?

Jason :

Yeah so this can be done through gradle for example, but without seeing how you're executing code or what tools you're using it's hard to help. This is one example though.

Gradle

apply plugin: 'application'

applicationDefaultJvmArgs = [
        "-Xss40m"
]

Executing the run task of gradle will allow the application, in any development environment, to run with the jvm arguments provided.

Maven

Create a file, if it doesn't exist, called jvm.config in the .mvn directory in your projects parent directory. The options provided will be supplied with the JVM. It should be noted that all options should be separated by a space, however in your case there is only one option.

File

/<myProject>/.mvn/jvm.config

File Content

-Xss50m

Guess you like

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