Version 8 (modified by jazz, 15 years ago) (diff) |
---|
2009-07-06
- 成大工科實習生 Java 教學
- 下載 JDK 6 文件
- 下載 JDK 6
- 設定 PATH 系統環境變數:"C:\Program Files\Java\jdk1.6.0_14\bin"
- 設定 CLASSPATH 系統環境變數:" . ; C:\Program Files\Java\jdk1.6.0_14\jre\lib\rt.jar"
- 驗證方法:
C:\>javac Usage: javac <options> <source files> C:\>java Usage: java [-options] class [args...] (to execute a class) or java [-options] -jar jarfile [args...] (to execute a jar file) C:\>echo %PATH% C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\Java\jdk1.6.0_14\bin << 必須有 C:\Program Files\Java\jdk1.6.0_14\bin C:\>echo %CLASSPATH% .; C:\Program Files\Java\jdk1.6.0_14\jre\lib\rt.jar; C:\Program Files\Java\jre6\lib\ext\QTJava.zip << 必須有 C:\Program Files\Java\jdk1.6.0_14\jre\lib\rt.jar
- 下載 Java Tutorial 的 HelloWorldApp 範例
- 編譯 HelloWorldApp?.java 與 Test.java
javac Test.java javac HelloWorldApp.java
- 執行 HelloWorldApp? 與 Test
- Java Tutorial
// 存為 Test.java import java.io.*; import java.lang.String; public class Test { public String myData; public String getMyData() { return myData; } public void setMyData(String data) { myData = new String(data); } public static void main(String args[]) { Test myTest = new Test(); myTest.setMyData("This is a test"); System.out.print(myTest.getMyData()); } }
- Java Tutorial
- 2005 年陽明/中研院 Java 物件導向設計投影片
- 200 Linux Study 教學(含錄影)
Attachments (1)
- HomeWork.png (9.3 KB) - added by jazz 15 years ago.
Download all attachments as: .zip