.class vs .java [英] .class vs .java
问题描述
.class文件和.java文件之间有什么区别?我试图让我的applet工作,但目前我只能运行它在Eclipse中,我还不能嵌入在HTML。
感谢
What's the difference between a .class file and a .java file? I am trying to get my applet to work but currently I can only run it in Eclipse, I can't yet embed in HTML. Thanks
**编辑:如何使用JVM编译?
** How to compile with JVM then?
推荐答案
.class文件是一个编译的.java文件。
A .class file is a compiled .java file.
.java是所有文本,并且是人类可读的。
.class是二进制(通常)。
.java is all text and is human readable.
.class is binary (usually).
通过转到命令行,导航到.java文件并运行
You compile a java file into a class file by going to the command line, navigating to the .java file, and running
javac "c:\the\path\to\your\file\yourFileName.java"
您必须在计算机上安装一个java SDK(从 Oracle ),并确保javac.exe文件位于计算机的PATH环境变量中。
You must have a java SDK installed on your computer (get it from Oracle), and make sure the javac.exe file is locatable in your computer's PATH environment variable.
此外, 第1课:编译&运行简单程序
Also, check out Java's Lesson 1: Compiling & Running a Simple Program
如果任何一个不清楚,请对此回复进行评论,我可以帮助:)
If any of this is unclear, please comment on this response and I can help out :)
这篇关于.class vs .java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!