.class 与 .java [英] .class vs .java

查看:16
本文介绍了.class 与 .java的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

.class 文件和 .java 文件有什么区别?我试图让我的小程序工作,但目前我只能在 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

**Edit: 那么如何用 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 文件并运行将 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.

此外,请查看 Java 的第 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 与 .java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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