gpt4 book ai didi

java - javac 可以从 stdin 编译吗?

转载 作者:塔克拉玛干 更新时间:2023-11-03 03:20:59 25 4
gpt4 key购买 nike

javac 可以从标准输入编译吗?像这样:

cat myfile | javac

最佳答案

不,没有这样做的选项。

来自documentation :

There are two ways to pass source code file names to javac:

  • For a small number of source files, simply list the file names on the command line.
  • For a large number of source files, list the file names in a file, separated by blanks or line breaks. Then use the list file name on the javac command line, preceded by an @ character.

Source code file names must have .java suffixes, class file names must have .class suffixes, and both source and class files must have root names that identify the class. For example, a class called MyClass would be written in a source file called MyClass.java and compiled into a bytecode class file called MyClass.class.

关于java - javac 可以从 stdin 编译吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8021886/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com