【问题标题】:What is the purpose of jvm.cfg file in relation to Java?jvm.cfg 文件与 Java 相关的目的是什么?
【发布时间】:2009-07-28 04:19:56
【问题描述】:

它有一些奇怪的关键字。请说明文件的一般用途。

【问题讨论】:

    标签: java configuration


    【解决方案1】:

    短版:

    控制在调用 java 或 javac 时可以使用启动标志选择的 JVM。

    长版:

    让我们从 cmets 开始

    # List of JVMs that can be used as an option to java, javac, etc.
    # Order is important -- first in this list is the default JVM.
    # NOTE that this both this file and its format are UNSUPPORTED and
    # WILL GO AWAY in a future release.
    

    所以我们有一个 'JVM' 的列表来传递给 java/javac。我们需要在这个文件的上下文中阐明什么是 JVM。

    让我们简单地说一句:

    -green ERROR
    

    和实验

    java -green > /dev/null
    Error: green VM not supported
    

    因此,ERROR 标志似乎表明配置不受支持。

    让我们继续

    -classic WARN
    

    并执行

    java -classic > /dev/null
    Warning: classic VM not supported; client VM will be used
    

    似乎“WARN”会将我们发送到默认的 JVM,这对我们来说似乎是“客户端”。

    那我们可以看看第一行

    -client IF_SERVER_CLASS -server
    

    这似乎表明默认是服务器除非机器是服务器类。

    下一个是

    -server KNOWN
    

    这意味着服务器 JVM 是已知的。

    最后

    -hotspot ALIASED_TO -client
    

    表示热点相当于客户端。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-11-15
      • 2022-10-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-21
      • 2011-11-03
      • 2015-02-14
      相关资源
      最近更新 更多