Rhythmk 一步一步學 JAVA (1): JAVA 開發環境配置

來源:互聯網
上載者:User

 1. 下載JDK    如:jdk-6u10-rc2-bin-b32-windows-i586-p-12_sep_2008.exe       下一步。。下一步安裝即可。

 2.  配置系統變數:

右擊“我的電腦”--選擇“屬性”--選擇“進階”--點擊“環境變數”

在“系統變數(S)”中

建立:JAVA_HOME:C:\Program Files\Java\jdk1.6

建立:CLASS_PATH:.;%JAVA_HOME%\lib

編輯:PATH:在最前面加上%JAVA_HOME%\bin;

3. 運行 CMD   命令  java -version  檢查是否安裝成功。

4. 下載MyEclipse    目前我安裝的是myeclipse-10.0-offline-installer-windows.exe。

5. 安裝完成啟動 MyEclipse 設定編碼格式 

 Edit -> set Encoding 為UTF-8

測試環境:

package App1.Rhythmk.com;import java.text.MessageFormat;import java.text.SimpleDateFormat;import java.util.*;public class FirstUnit {    /**     *    擷取系統時間     */    public static void main(String[] args) {        System.out.println("Hello World!");        Date time = new Date();        System.out.println(time.toString());                SimpleDateFormat dformat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");        System.out.println(dformat.format(time));        // 擷取系統時間表  SimpleDataFormat 預設格式化 yyyy-MM-dd HH:mm:ss        SimpleDateFormat dformat2=new SimpleDateFormat();        System.out.println(dformat.format(time));                // 字串格式化        String.format("abcdefjhijk", 10,"rhythmk");        MessageFormat  msgFormat=new  MessageFormat(" abck- -{0} -de -{1} - fjh  - {0}- ijdkakdkak");        System.out.println("格式化字元:"+ msgFormat.format(new String[]{                "str1",                "Str2"        }));    }}

 

   

Date time = new Date();
System.out.println(time.toString());

SimpleDateFormat dformat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println(dformat.format(time));
// 擷取系統時間表 SimpleDataFormat 預設格式化 yyyy-MM-dd HH:mm:ss
SimpleDateFormat dformat2=new SimpleDateFormat();
System.out.println(dformat.format(time));

// 字串格式化
String.format("abcdefjhijk", 10,"rhythmk");
MessageFormat msgFormat=new MessageFormat(" abck- -{0} -de -{1} - fjh - {0}- ijdkakdkak");
System.out.println("格式化字元:"+ msgFormat.format(new String[]{
"str1",
"Str2"
}));

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.