如何设置JAVAC编译文件的输出 [英] How to set the output of a JAVAC compiled file

查看:51
本文介绍了如何设置JAVAC编译文件的输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的上一个问题问如何使用命令 JAVAC 编译文件.我仍然不知道如何设置已编译数据的输出文件.

My previous question asked how to compile files with the command JAVAC. I still don't know how to set the output file of the compiled data.

推荐答案

javac 的输出始终是classfile,并且文件名与其中包含的类的名称匹配.(包含多个类的源文件将产生多个输出文件.)

The output of javac is always classfiles, and the name of the file matches the name of the class contained within it. (A source file with multiple classes in will result in multiple output files.)

如果您使用 -d 命令行选项,则 javac 还将使用该类的软件包来生成具有 -d 选项指定根目录.否则,每个类文件将与编译该文件的源文件一起输出到同一目录中.

If you use the -d command line option, javac will also use the package of the class to generate a directory hierarchy, with the -d option specifying the root. Otherwise, each class file will be output in the same directory as the source file from which it was compiled.

这篇关于如何设置JAVAC编译文件的输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆