java ²Ù×÷¶ÌÐÅèʵÏÖ¶ÌÐÅȺ·¢
²ÉÓô®¿Ú²Ù×÷½øÐжÌÐÅÊÕ·¢,ÊDZȽϳ£¼ûµÄÒ»ÖÖ·½Ê½.±ÈÈç,ºÜ¶àȺ·¢Èí¼þ,ÓõľÍÊÇÕâÖÖ·½·¨.
1.ÅäÖÃcomm.jar.
Comm.jarÊÇSubʵÏֵײ㴮¿Ú²Ù×÷µÄAPI,µ÷ÓÃÁ˱¾µØµÄDLLÎļþ,ÒòΪJava±¾Éí²»¾ß±¸Ö±½Ó·ÃÎÊÓ²¼þÉèÖõÄÄÜÁ¦,¶¼ÊÇͨ¹ýµ÷Óñ¾µØ·½·¨À´Êµ
ÏÖµÄ.¿ÉÒÔJavaµÄ¹Ù·½ÍøÕ¾ÏÂÔØ.ÏÂÔØÖ®ºó°ÑÆäÖÐComm.jar°üµ¼Èëµ½¹¤³ÌµÄClasspathÖÐ,°ÑÁíÍâÁ½¸ö·Ç³£ÖØÒªµÄÎļþ
javax.comm.propertiesºÍwin32com.dll¿¼±´µ½ÄãµÄ¹¤³ÌĿ¼ÏÂ,¼´java.userÏÂ.
2.´ò¿ª´®¿Ú.
ÔÚ´ò¿ª´®¿ÚÇ°Ê×ÏÈÒª¼ÓÔØWin32com.dll,ÒòΪÎÒÃÇûÓаÑËü·Åµ½JRE·¾¶ÏÂ,ËùÒÔ±ØÐëÒª×Ô¼ºÏÔʽµÄ¼ÓÔØ.
String driverName = "com.sun.comm.Win32Driver";
CommDriver driver = null;
try {
System.loadLibrary("win32com");
driver = (CommDriver) Class.forName(driverName).newInstance();
driver.initialize();
} catch (InstantiationException e1) {
logger.error("1:" + e1.getMessage());
} catch (IllegalAccessException e1) {
logger.error("2:" + e1.getMessage());
} catch (ClassNotFoundException e1) {
logger.error(e1.getMessage());
}
È»ºó»ñÈ¡ÄãÖ¸¶¨µÄ¶Ë¿Ú:
SerialPort sPort = null;
CommPortIdentifier portID;
String owner = new String("modemn");
int keeptime = 5000;
Enumeration portList;
portList = CommPortIdentifier.getPortIdentifiers();
// Èç¹ûÓжà¸ö¶Ë¿Ú
while (portList.hasMoreElements()) {
portID = (CommPortIdentifier) portList.nextElement();
if (portID.getName().equals(com))
try {
sPort = (SerialPort) portID.open(owner, keeptime);
break;
}// ´ò¿ªÒ»¸ö´®¿Ú
catch (PortInUseException e) {
logger.fatal(e.getMessage());
System.exit(1);
}
}// while
³É¹¦´ò¿ª¶Ë¿ÚÖ®ºó,ÉèÖö˿ڵÄÏà¹Ø²ÎÊý,È粨ÌØÂÊ¡¢Êý¾Ýλ¡¢ÆæżУÑéλµÈ.Õâ¸ö¸ú¾ßÌåµÄÉ豸ÓйØ,²»¹ýÒ»°ãÇé¿öϲ¨ÌØÂÊΪ9600£¬Êý¾ÝλΪ8£¬Í£Ö¹Î»Îª1£¬ÆæÅ
Ïà¹ØÎĵµ£º
±¾ÎÄÊ×ÏȽéÉÜjavaÁ¬½ÓoracleҪעÒâµÄ¼¸µã£¬È»ºó½éÉܼ¸ÖÖ³£ÓõÄÁ¬½Ó·½Ê½¡£
Ò»¡¢¼¸µã×¢Ò⣺
1¡¢ÔÚ¿Í»§¶ËÈí¼þ¿ª·¢ÖÐʹÓÃThinÇý¶¯³ÌÐò
ÔÚ¿ª·¢JavaÈí¼þ·½Ã棬OracleµÄÊý¾Ý¿âÌṩÁËËÄÖÖÀàÐ͵ÄÇý¶¯³ÌÐò£¬¶þÖÖÓÃÓÚÓ¦ÓÃÈí¼þ¡¢applets¡¢servletsµÈ¿Í»§¶ËÈí¼þ£¬ÁíÍâ¶þÖÖÓÃÓÚÊý¾Ý¿âÖеÄJava´æ´¢¹ý³ÌµÈ·þÎñÆ ......
ͨ³££¬¶àÏß³ÌÖ®¼äÐèҪе÷¹¤×÷¡£ÀýÈ磬ä¯ÀÀÆ÷µÄÒ»¸öÏÔʾͼƬµÄÏß³ÌdisplayThreadÏëÒªÖ´ÐÐÏÔʾͼƬµÄÈÎÎñ£¬±ØÐëµÈ´ýÏÂÔØÏß³ÌdownloadThread½«¸ÃͼƬÏÂÔØÍê±Ï¡£Èç¹ûͼƬ»¹Ã»ÓÐÏÂÔØÍ꣬displayThread¿ÉÒÔÔÝÍ££¬µ±downloadThreadÍê³ÉÁËÈÎÎñºó£¬ÔÙ֪ͨdisplayThread“ͼƬ׼±¸Íê±Ï£¬¿ÉÒÔÏÔʾÁË”£¬Õâʱ£¬displayThread ......
²âÊÔ»·¾³£ºwin2000+jdk1.4+jb2006
import java.io.*;
import java.util.Enumeration;
//import java.util.zip.*;
import org.apache.tools.zip.*;
public class Test {
//½âѹÎļþ
public static void extZipFileList(String zipFileName, String extPlace) {
try {
  ......
package homework02;
import java.util.Scanner;
/*
* ±àдÁ½¸öÀࣺAºÍB£¬ÀàA´´½¨µÄ¶ÔÏó¿ÉÒÔ¼ÆËãÁ½¸öÕýÕûÊýµÄ×î´ó¹«Ô¼Êý£¬ÀàB´´½¨µÄ
* ¶ÔÏó¿ÉÒÔ¼ÆËãÁ½¸öÊýµÄ×îС¹«±¶Êý¡£ÒªÇó£ºÀàBÖÐÓÐÒ»¸ö³ÉÔ±±äÁ¿Ê±ÓÃÀàAµÄÉùÃ÷¶ÔÏó¡£
*/
public class A {
private int m;
private int n;
public A(){
this.intput();
......
http://java.sun.com/javase/technologies/hotspot/vmoptions.jsp
Categories of Java HotSpot VM Options
Standard options recognized by the Java HotSpot VM are described on the Java Application Launcher reference pages for Windows
, Solaris
and Linux
. This document deals exclusively wit ......