java µÄ°æ±¾Òì³£
ѧϰ֮·×ÜÊDz¢²»Æ½Ì¹µÄ£¬Õâ²»£¬Ò»¿ªÊ¼¾ÍÓöµ½ÎÊÌâÁË£ºBad version number in .class file¡£°æ±¾²»¶Ô£¿¿ÉÊÇÎÒÓõÄjavaÒÔ¼°javac¶¼ÊÇJDK5ѽ£¬Ôõô»ØÊ£¿³ýÁ˱àÒë°æ±¾¸úÔËÐа汾²»Ò»ÖÂÍâÊDz»»á³öÏÖÕâÖÖ¿ÉÄܵġ£Í»È»ÏëÆðÇ°¼¸ÌìÊÔÁËÒ»ÏÂJDK6£¬°ÑEclipseµÄJDK±àÒëÆ÷Ñ¡³ÉJDK6ÁË¡£¹ûÈ»£¬½«Æä¸Ä»ØÈ¥JDK5¾ÍÐÐÁË¡£
=====================
ÖÕÓÚÅöµ½Õâ¸öÎÊÌâÁË£¬
java.lang.UnsupportedClassVersionError: Bad version number in .class file
ÕâÊÇjavaµÄ±àÒëµÄ°æ±¾ÎÊÌ⣬°Ñ°æ±¾¸Ä³ÉÒ»ÖµľͿÉÒÔÁË£¬ÀýÈçjdk ºÍjre¶¼ÉèΪ6.0¡£ÔÚmyeclipseµÄÅäÖÃÐÅÏ¢À¾Í·Ö±ðÖ¸ËüµÄ±àÒ뼶±ð£¨complier£©ºÍjavaÔËÐл·¾³£¨install jre£©.
Èç¹ûÊÇweb¹¤³Ì£¬Äã»áºÜÒâÍâµÄ·¢ÏÖ£¬ÖØÐÂÆô¶¯tomcatÖ®ºó£¬Õâ¸ö´íÎóÈÔÈ»´æÔÚ¡£½Ó×Å£¬Äã¾ÍÔÚmyeclipseÀïconfigure severÑ¡Ôñ¶ÔÓ¦µÄtomcat £¬È»ºóÑ¡ÔñjdkÑ¡Ï°ÑtomatʹÓõÄjdkÒ²¸Ä¹ýÀ´£¬ÖØв¿Êð£¬ÖØÐÂÆô¶¯tomcat£¬¾ÍûÎÊÌâÁË¡£
Ïà¹ØÎĵµ£º
import java.text.DateFormat;
import java.util.Calendar;
import java.util.Date;
/**
* @author troy(J2EE)
* @version 1.0
*/
public class Test {
public static void main(String[] args) throws Exception {
DateFormat df = DateFormat.getDateInstance();
&n ......
¹Ø¼ü×Ö: µ×²ãÊý¾Ý Ãû´Ê½âÊÍ£º ²¹Â룺1 ÔÚ¼ÆËã»úϵͳÖУ¬ÊýÖµÒ»ÂÉÓв¹ÂëÀ´±íʾ(´æ´¢). ʹÓò¹Âë,¿ÉÒÔ½«·ûºÅλºÍÆäËûλͳһ´¦Àí;ͬʱ,¼õ·¨Ò²¿É°´¼Ó·¨À´´¦Àí.ÁíÍâ,Á½¸öÓò¹Âë±íʾµÄÊý¾ÝÏà¼Óʱºò,Èç¹û×î¸ßλ(·ûºÅλ)Óнøλ,Ôò½øÎ¥±»ÉáÆú. 2 ²¹ÂëÓëÔÂëµÄת»»¹ý³Ì¼¸ºõÊÇÏàͬµÄ ÊýÖµµÄ²¹Âë±íʾҲ·ÖÁ½ÖÖÇé¿ö£º £¨1£©ÕýÊýµÄ²¹Âë:ÓëÔ ......
»ñµÃmysqlºÍoracleÁ´½ÓµÄÀà
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class ConnectDB {
private static final String MYSQL = "jdbc:mysql://";
private static final String ORACLE = "jdbc:oracle:thin:@";
private ConnectD ......