posted on 26 Jan 2009 00:34 by pandamaster in Programming
by Patrickz, Jul 13 2008, 12:48 PM
พอดีกำลังมองหาดูว่า จะใช้ Java บน Windows Mobile ได้อย่างไรบ้าง
พอดีไปเจอ blog
Java on PocketPC (Unofficial FAQ) มี solutions อีกจำนวนหนึ่ง
posted on 26 Jul 2008 02:03 by pandamaster in Programming
J2EE 1.4
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/index.html
Javaee 5
http://java.sun.com/javaee/5/docs/tutorial/doc/
edit @ 26 Jul 2008 02:12:24 by PandaMaster
posted on 15 Jul 2008 21:54 by pandamaster in Programming
- ทำการลงโปรแกรม EditPlus และ SDK ของ JAVA ชื่อ J2SE Development Kit ลงในเครื่องก่อน เพื่อให้ในเครื่องมีตัว Compile และ Editor เพื่อใช้ในการทำงานเสียก่อน
- เปิดโปรแกรม EditPlus และไปที่ Tools และตามด้วยเมนู Configure User Tools
- ตัวโปรแกรมจะเปิดหน้าต่างใหม่ ที่ชื่อว่า Preferences และตัว Cursor อยู่ที่ User tools ให้คลิ้กที่ปุ่ม Groups Name เพื่อทำการเปลี่ยนชื่อ Groups เป็น JAVA ซึ่งระบบจะขึ้นหน้าต่าง Rename User Tool Group ให้กรอง และเมื่อกรองเสร็จแล้วกด OK ออกมา และเราจะเห็นชื่อ Group 1 จากของเดิม เปลี่ยนเป็น JAVA แล้ว
- ต่อมาเราจะมาทำการสร้างตัว Command ในการ Compile ในตัวโปรแกรม EditPlus โดยไปที่ปุ่ม Add Tools และไปที่ Program ซึ่งโปรแกรมที่เราจะ Add เข้านี้มีชื่อว่า JAVA Compiler หรือชื่อ javac.exe นั้นเอง โดยให้ Browse ไปที่อยู่ของ javac.exe ซึ่งส่วนมากจะอยู่ใน directory bin ของ JAVA รุ่นนั้นๆ เช่น "C:\Java\jdk1.5.0_01\bin\javac.exe" ซึ่งแล้วแต่เราว่าเราจะเอาไว้ที่ไหนนั้นเอง เมื่อ Browse หาเจอแล้ว ตัว Path ของไฟล์ javac.exe จะถูกนำมาใส่ไว้ในช่อง Command ให้เราเลยทันที และใน Menu Text ให้ใส่ Compile เข้าไป
- จากนั้นในส่วนของช่อง Argument จะใช้ในการใส่ค่าของชื่อไฟล์ของเรา ในที่นี้ให้ไปที่ปุ่ม และเลือกที่ File Name ซึ่งตามหลักการ Compile ใน Command Prompt ใน Dos นั้นจะมีรูปแบบคือ "C:\javac HelloWorld.java" ตัวโปรแกรมจะทำการใส่ไปให้เราเองดังที่ได้กล่าวไปในตอนแรกแล้ว
- ในช่องของ Initial directory นั้นปกติใช้เพื่อทำการบอกตัวโปรแกรมว่าให้ทำการ compile ที่ไหน โดยไปทีปุ่มเครื่องหมายลูกศรชี้ลง แล้วเลือก File Directory เมื่อทำทั้งหมดเสร็จแล้วให้กด Apply
- ต่อมาเราจะมากล่าวถึงในส่วนของการให้โปรแกรมที่เขียนด้วยภาษา JAVA นั้นสามารถทำงานได้หลังจากทำการ Compile แล้ว ให้ที่ไป Add Tools และไปที่ Program ซึ่งโปรแกรมที่เราจะ Add เข้านี้มีชื่อว่า JAVA Interpeter หรือชื่อ java.exe ซึ่งส่วนมากจะอยู่ใน directory bin ของ JAVA รุ่นนั้นๆ เช่น "C:\Java\jdk1.5.0_01\bin\java.exe" นั้นเอง เมื่อ Browse หาเจอแล้ว ตัว Path ของไฟล์ java.exe จะถูกนำมาใส่ไว้ในช่อง Command ให้เราเลยทันที และใน Menu Text ให้ใส่ Run เข้าไป
- จากนั้นในส่วนของช่อง Argument จะใช้ในการใส่ค่าของชื่อไฟล์ของเรา ในที่นี้ให้ไปที่ปุ่ม และเลือกที่ File Name Without Extension ซึ่งตามหลักการ Interpeter Running ใน Command Prompt ใน Dos นั้นจะมีรูปแบบคือ "C:\java HelloWorld" ตัวโปรแกรมจะทำการใส่ไปให้เราเองดังที่ได้กล่าวไปในตอนแรกแล้ว
- เมื่อทำการติดตั้งเสร็จแล้ว เราก็จะได้คำสั่งในการ Compile และ Run ออกมา
- ทดสอบโดยการเขียนโปรแกรมทดสอบ HelloWorld
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
- และทำการ Save เป็น HelloWorld.java (หรือให้ชื่อไฟล์เหมือนกับชื่อของ Class ที่ทดสอบ)
- เมื่อ Compile จะได้ผล
———- Compile ———-
Output completed (1 sec consumed) - Normal Termination
- และเมื่อ Run จะได้ผล
———- Run ———-
Hello World!
Output completed (0 sec consumed) - Normal Termination
- เมื่อได้แบบนี้แล้วแสดงว่าติดตั้งแต่สมบูรณ์เรียบร้อย ……
ที่มา : http://www.thaicyberpoint.com/ford/blog/id/47/
posted on 15 Jul 2008 21:51 by pandamaster in Programming
A. You can setup the Java compiler or C/C++ compiler on 'User tools' page of Preferences dialog box. Please press 'Add Tool'->'Program' button and try to set the options like this:
Example 1. Java Compiler
Menu text: Java Compiler
Command: c:\java\bin\javac.exe
Argument: "$(FilePath)"
Initial directory: $(FileDir)
Capture output: ON
Example 2. Turbo C 2.01
Menu text: Turbo C
Command: c:\tc\tcc.exe
Argument: -Ic:\tc\include -Lc:\tc\lib -n$(FileDir) $(FilePath)
Initial directory: c:\tc
Capture output: ON
Example 3. Borland C++ 5.5
Menu text: Borland C
Command: c:\bc\bin\bcc32.exe
Argument: -Ic:\bc\include -Lc:\bc\lib -n$(FileDir) $(FilePath)
Initial directory: c:\bc\bin
Capture output: ON
Example 4. Visual C++
Menu text: Visual C++
Command: c:\msdev\vc98\bin\cl.exe
Argument: "$(FilePath)"
Initial directory: $(FileDir)
Capture output: ON
The above settings must be replaced with the actual path of the Java compiler or C/C++ compiler on your system.
After the setting is completed, you can run the command on 'Tools' menu, and the result will be shown in the Output Window at the bottom. You can also run the tool through the shortcut key (Ctrl + 0-9) or thought the icons on the 'User toolbar'.
To run the compiled Java class file, you can set the options like this:
Menu text: Java
Command: c:\java\bin\java.exe
Argument: $(FileNameNoExt)
Initial directory: $(FileDir)
The 'Command' field should be replaced with the actual path of the Java interpreter.
To run the compiled *.exe file, you can set the options like this:
Menu text: Run
Command: $(FileNameNoExt)
Argument:
Initial directory: $(FileDir)
ที่มา : http://www.editplus.com/faq.html
edit @ 15 Jul 2008 22:06:46 by PandaMaster