java启动参数和jar启动

java启动jvm参数,可以指定参数。jar包启动命令:java -jar ***.jar --spring.profiles.active=dev -verbose:class


1.-Dspring.profiles.active=dev 
 这个可以在spring-boot启动中指定系统变量,多环境(测试、预发、线上配置)的区分
2. 在排查jar包冲突时,可以指定启动的-verbose:class  打印出启动的应用实际加载类的路径,来排查来源。
3. jvm堆设值: -Xmx3550m -Xms3550m -Xmn2g -Xss128k


jvm参数中的java option需要修改后重启生效。
jvm参数可选配置如下:
options include:
    -client       to select the "client" VM
    -server       to select the "server" VM
    -hotspot      is a synonym for the "client" VM  [deprecated]
                  The default VM is client.
 
    -cp
    -classpath
                  A ; separated list of directories, JAR archives,
                  and ZIP archives to search for class files.
    -D=    
                  set a system property
    -verbose[:class|gc|jni]
                  enable verbose output
    -version      print product version and exit
    -version:
                  require the specified version to run
    -showversion  print product version and continue
    -jre-restrict-search | -jre-no-restrict-search
                  include/exclude user private JREs in the version search
    -? -help      print this help message
    -X            print help on non-standard options
    -ea[:...|:]
    -enableassertions[:...|:]
                  enable assertions
    -da[:...|:]
    -disableassertions[:...|:]
                  disable assertions
    -esa | -enablesystemassertions
                  enable system assertions
    -dsa | -disablesystemassertions
                  disable system assertions
    -agentlib:[=]
                  load native agent library , e.g. -agentlib:hprof
                    see also, -agentlib:jdwp=help and -agentlib:hprof=help
    -agentpath:[=]
                  load native agent library by full pathname
    -javaagent:[=]
                  load Java programming language agent, see java.lang.instrument

你可能感兴趣的:(java,Java)