怎樣把java 轉換成 .class 並把它執行??

2007-02-04 1:32 pm
1.) 我想間要 Download 邊個 softwaver 可以將 java 轉換成 .class?? J2SE v 1.4.2_13 SDK , J2SE v 1.4.2_13 JRE , 定係要其他??

2.) 裝左個softwaver 之後點用 ( 點將 java 轉換成 .class ) ??

3.) 點樣執行 .class??

長盡D , 唔該晒!!

回答 (2)

2007-02-04 8:44 pm
✔ 最佳答案
1) 你需要Java SDK (e.g. J2SE v 1.4.2_13 SDK)來將".java"檔案轉換成".class"檔案。Java SDK及Java JRE (e.g. J2SE v 1.4.2_13 JRE)皆能執行".class"檔。


2) javac.exe *.java
where "javac.exe" is located under the bin directory of your SDK installation and "*.java" are the Java files for compilation.


3) Provide that there is a static "main" method in a class with the following signature.

public static void main(String[] args);

Then you can execute it with the following command.

java.exe ABC

where "ABC" is the name of the enclosing class of the main method.

There are also alternate means to execute a Java module.
2007-02-04 2:02 pm
please use javac the java compiler to do it.

full direction is here :

http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javac.html

happy java

alien


收錄日期: 2021-04-26 17:21:58
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20070204000051KK00513

檢視 Wayback Machine 備份