Is the creation of Java class files deterministic?

前端 未结 11 1635
抹茶落季
抹茶落季 2020-12-02 11:04

When using the same JDK (i.e. the same javac executable), are the generated class files always identical? Can there be a difference depending on the

11条回答
  •  长情又很酷
    2020-12-02 11:41

    For the question:

    "What are the circumstances where the same javac executable,when run on a different platform, will produce different bytecode?"

    The Cross-Compilation example shows how we can use the Javac option:-target version

    This flag generates class files which are compatible with the Java version we specify while invoking this command. Hence the class files will differ depending on the attributes we supply during the compaliation using this option.

提交回复
热议问题