??xml version="1.0" encoding="utf-8" standalone="yes"?>91wwwcom在线观看,一区二区三区四区在线,国产粉嫩一区二区三区在线观看http://www.aygfsteel.com/xcp/category/48796.html      我也不在是我zh-cnWed, 08 Jun 2011 21:51:50 GMTWed, 08 Jun 2011 21:51:50 GMT60九、java1.5以上新特性-Annotationhttp://www.aygfsteel.com/xcp/archive/2011/06/06/351817.htmlxcpxcpMon, 06 Jun 2011 10:12:00 GMThttp://www.aygfsteel.com/xcp/archive/2011/06/06/351817.htmlhttp://www.aygfsteel.com/xcp/comments/351817.htmlhttp://www.aygfsteel.com/xcp/archive/2011/06/06/351817.html#Feedback0http://www.aygfsteel.com/xcp/comments/commentRss/351817.htmlhttp://www.aygfsteel.com/xcp/services/trackbacks/351817.html     a.不直接媄响程序代码的语义Qannotation可以从源文gQclass文g或者以在运行时反射的多U方式读?br />     b.cd标签javadoc
    c.因ؓproperty,xml的配|文件比较繁?nbsp;   

2、Annotation的定义方?br />     a.Class,Interface,enum,Annotation是同U别的类标识W?br />     b.public @interface AnnotationTest{}    //@+interface = annotation的定义哈
       public @interface AnnotationTest2{
            String value();  //默认构造方?br />        }
       public @interface AnnotationTest3{
           String value1();
       }
      public @interface AnnotationTest4{
            String[] value();
       }     
    
public @interface AnnotationTest5{
            String value1();
            String value2();
       }     

3、Annotation的用方?br />     a.@AnnotationTest 来用就可以了;可以攑֜c,ҎQ属性上面;
    b.@AnnotationTest2("test")  == @AnnotationTest2(value="test");
    c.@AnnotationTest3(value1="test3");
    d.@AnnotationTest4({"test1","test2"}); == @AnnotationTest4(value=({"test1","test2"})
    e.@AnnotationTest5(value1="hello",value2="world")

4、jdk5.0以后自带的Annotation详解
    a.Override (重写)
    b.Deprecated (抛弃的,已过?/span>?
    c.SuppressWarningsQ压制警告,屏蔽警告Q?br />       SuppressWarnings("unchecked"); //屏蔽一个警?br />       SuppressWarnings({"unchecked","deprecation"})//屏蔽[多个]警告     注意{key1,key2}的用,以数l的形式存放
      
      有哪些常用的警告cd呢?
         Q》unchecked,deprecration,可自定义

5、Annotation的高U特?nbsp;
    一、怎么来处理Annotation
    a.告知~译E序如何处理@Retention(重要)
        java.lang.annotation.Retention型态可以在您定自定义Annotation型态时Q指C编译程序应该如何对待你的自定义的Annotation型?->预设上编译程序会Annotation信息留在[.class默认]案?/span>Q但不会被java虚礼取,而仅用于~译E序或工L序运行时的提CZ?/span>Q目的) 
        1)本n是一?注释cd Retention
        2)用一?  RetentionPolicy value();属?见jdk api
        3)RetentionPolicy是什么呢Q它是一个枚丄型的注释保留{略Q?a href="../../../java/lang/annotation/RetentionPolicy.html#CLASS">CLASS默认Q编译器把注释记录在类文g中,但在q行?VM 不需要保留注释)?a href="../../../java/lang/annotation/RetentionPolicy.html#RUNTIME">RUNTIMEQ编译器把注释记录在类文g中,在运行时 VM 保留注释,因此可以反射性地dQ?a href="../../../java/lang/annotation/RetentionPolicy.html#SOURCE">SOURCEQ编译器要丢弃的注释Q?nbsp; 
        4).例子
           @Target(value={TYPE,FIELD,METHOD,PARAMETER,CONSTRUCTOR,LOCAL_VARIABLE})
           @Retention(value=SOURCE)    ==  @Retention(RetentionPolicy.SOURCE) //提供了一个策略类
            //可以看出来Q他主要是压制警告Q所以没有必要保存到class文g里面?br />
           public @interface SuppressWarnings{。。。} 
        5).RUNTIME旉过反射来得到Annotation相关的信?br />         6).AnnotatedElement 是提供反射处理annotation的接?Class,constructor,Field,Method,Package都实Cq个接口Q然后我们在反射的时候可以先得到Class,Constructor,Method{对象再通过里面l承?
getAnnotation
,getAnnotations,getDeclaredAnnotations,isAnnotationPresentҎd到类Q构造方法,ҎQ属性等前面的Annotation程信息?br />     
   b.限定Annotation的用对?@TargetQ重要)
         1).注释cd Target,ҎQElementType[] value
         2).枚D ElementType:PACKAGE[包声明],TYPE[cR接口(包括注释cdQ或枚D声明],ANNOTATION_TYPE[注释cd==annotationc里面可以定义],CONSTRUCTOR[构造方法],METHOD[Ҏ],FIELD[字段声明Q包括枚丑ָ量)]  ,LOCAL_VARIABLE[局部变量声明] ,PARAMETER[参数声明] 
         3).实例
            @Retention(RetentionPolicy.RUNTIME)
            @Target({
ElementType.TYPE,
ElementType.METHOD,ELEMENTType.FIELD})
            public @interface AnnotationTest6{
                    String value();
             }
   
    c.子类是否l承父类的Annotation-Inherited          1).注释cd Inherited     声明的AnnotationQ?/span>
此元注释仅促成从类l承注释Q对已实?/span>接口的注释无?/span>
Ҏ口v作用
             
@Documented
@Retention(value=RUNTIME)
@Target(value=ANNOTATION_TYPE)
public @interface Inherited 
          2).使用Q如果我们在新徏Annotation对象事,如果声明?div style="display: inline-block; ">
Inherited׃自动l承Q反知则不?br />          3).实例Q?br />              @Retention(RetentionPolicy.RUNTIME)
              @
Inherited
              public @interface AnnotationTest6{String value();}
             
             @
AnnotationTest6("haha")
              public class Parent{}
   
              public class Child extends Parent{}

              然后通过反射LChild的所有Annotation
             

    
d.利用反射得到Annotation信息[@Retention(value=RUNTIME)]
        1)用上面的实例Q?nbsp;
 AnnotationTest5
        2)真正解析代码Q?nbsp;
               public Class MyTest{
                    @AnnotationTest5(value1="hello",value2="world")
                    public void output(){
                        System.out.println("test annotation");
                    }
               }
             
               public class MyReflection{
                    public static void main(String args[]){
                             MyTest t = new MyTest();
                            Class<MyTest> c = MyTest.class;
                            Class<
AnnotationTest5> a = AnnotationTest5.class;
                            Method m = c.getMethod("output",new Class[]{});
                            if(m.isAnnotationPresent(a)){
                                    m.invoke(t,new Object[]{});
                                    //Annotation a1 = m.getAnnotation(a);
                                    MyAnnotationTest5 t5 =  
m.getAnnotation(a);
                                    System.out.println(t5.value1);
                                    System.out.println(t5.value2);
                              }

                              Annotation[] ans = m.getAnnotations();
                              for(Annotation an : ans){
                                 System.out.println(an.annotationType().getName());   //但这p看Annotation选择的U生成策?SOURCE,CLASS,RUNTIME[SuppressWarnings׃会显C出来]
                              }
                    }
                }
6、应?br />    a.javadoc
         1)注释cd Documented
         2)实例:一般我们生javadoc的时候,没有把我们自定义的annotation昄昄出来Q我们要怎么把我们写的annotation信息也显C在javadoc里面?
            @Documented   //q一句就是在生成javadoc的时候,如果遇到下面定义的annotationp昄出来
            public @interface DocumentedAnnotation{
                String value() default "test";
           }
  
           public class DocumentedTest{
                 /*
                 * 试生成javadoc
                 */
                 @
DocumentedAnnotation(value="welcome")
                  public void testJavadoc(){
                         System.out.println("哈哈");
                   }  
           } 

           点击myeclipse里面的project-->generate javadoc->讄 可以生成javadoc?/div>

xcp 2011-06-06 18:12 发表评论
]]>
十、java1.5以上新特性-反射机制与动态代?/title><link>http://www.aygfsteel.com/xcp/archive/2011/06/06/351818.html</link><dc:creator>xcp</dc:creator><author>xcp</author><pubDate>Mon, 06 Jun 2011 10:12:00 GMT</pubDate><guid>http://www.aygfsteel.com/xcp/archive/2011/06/06/351818.html</guid><description><![CDATA[反射机制与动态代?<img src ="http://www.aygfsteel.com/xcp/aggbug/351818.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/xcp/" target="_blank">xcp</a> 2011-06-06 18:12 <a href="http://www.aygfsteel.com/xcp/archive/2011/06/06/351818.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>八、java1.5以上新特性- 静态导入包、不定参?/title><link>http://www.aygfsteel.com/xcp/archive/2011/06/06/351815.html</link><dc:creator>xcp</dc:creator><author>xcp</author><pubDate>Mon, 06 Jun 2011 09:59:00 GMT</pubDate><guid>http://www.aygfsteel.com/xcp/archive/2011/06/06/351815.html</guid><description><![CDATA[<p>一、静态包导入<br />    1。比如多Z个类里面有很多的静态方法,而在另一个类里面使用的频率也比较的高Q如ComUtil.add(...),ComUtil.update(...){等Q这hơ都要写ComUnitl.Ҏ名,所以可以直接用方法名吗?{案是肯定的<br />    2。用语?br />        import static com.ComUtil.add;<br />        import static com.ComUtil.update;<br />    3。个人感觉没什么用<br /><br /><br />二、不定参?br />    public static  int  sum(int ... nums){<br />        int sum= 0;<br />        for(int i=0;i<nums.length;i++){<br />            temp+=nums[i];<br />        }<br />        return sum;<br />    }</p><img src ="http://www.aygfsteel.com/xcp/aggbug/351815.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/xcp/" target="_blank">xcp</a> 2011-06-06 17:59 <a href="http://www.aygfsteel.com/xcp/archive/2011/06/06/351815.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>七、java1.5以上新特性-枚Dhttp://www.aygfsteel.com/xcp/archive/2011/06/06/351808.htmlxcpxcpMon, 06 Jun 2011 06:48:00 GMThttp://www.aygfsteel.com/xcp/archive/2011/06/06/351808.html1.枚D是jdk5.0以后的全新类Q跟class,interface,annotation的别一P关键字enum?br />
2.W一个实例 
    public enum Color{ //定义
        Red,White,Blue;
        public static void main(){
            Color xx = Color.Red;//使用
        }
    }

3.enum 提供的常用方?br />    //两个常用的静态方?values(),valueOf()
    for(Color c : c.values()){
        System.out.println(c);
    }

4.enum ?span style="color: red">构造方?/span>
    publc enum Coin{
        penney(1),nickel(3),dime(10),quarter(25);

        private int value;
        public Coin(int value){
            this.value=value;
        }
        
        public static void main(String args[]){
            Coin c = Coin.quarter;
            System.out.println(c.getValue());
        } 
    }

5.enum的用场所
    权限控制、游戏方向、需要固定生类对象的数?br />    

xcp 2011-06-06 14:48 发表评论
]]>
六、java1.5以上新特性-范型http://www.aygfsteel.com/xcp/archive/2011/06/05/351778.htmlxcpxcpSun, 05 Jun 2011 08:51:00 GMThttp://www.aygfsteel.com/xcp/archive/2011/06/05/351778.html1。由?br />    ByteFoo->private Byte foo;
    StringFoo->private String foo;
    BooleanFoo->private boolean foo;
    DateFoo->private Date foo;
    XcpFoo->private xcp foo;

2?.4以前的解x?br />    ObjectFoo->private Object foo;  //Ҏ出现ClassCastExceptionQ类型{换错?br />
3?.5新特性的解决ҎQ范?br />    public Class MyFoo<T>{
        private T foo;
    }

4。扩?br />    public Class MyFoo<T>{
        private T[] foos; //{等
    }

5.再度扩展Q限制范型用类?br />    public Class MyFoo<T extends List>{ //不管是承父cM实现接口都用extends
        private T foo;
    }


6.再度扩展Q类型通配声明-->使用时的通用Ҏ
     public Class MyFoo<T extends List>{
        private T foo;
        public static void main(String args[]){
            MyFoo<ArrayList> foo1 = new MyFoo<ArrayList>();
            MyFoo<LinkedList> foo2 = new MyFoo<LinkedList>();
            
            //现在我想声明一个变量,卛_以放ArrayListQ也可以放LinkedList
            MyFoo<? extends List> foo3 =null;  //list的子c?/span>
            foo3 = new MyFoo<ArrayList>();
            foo3 = new MyFoo<LinkedList();

            
            MyFoo<? super List> foo4 =null; //list的父c?/span>
            foo4 = new MyFoo<Object>();   //q就只能为Object了,因ؓList的超父类有Object
        
            MyFoo<?>  foo5 = null;    //Lcd== ? extends Object
            foo5 = new MyFoo<Integer>();
            foo5 = new MyFoo<String>();
      }
    }
    

xcp 2011-06-05 16:51 发表评论
]]>
五、java的Build path菜单http://www.aygfsteel.com/xcp/archive/2011/06/05/351763.htmlxcpxcpSat, 04 Jun 2011 18:04:00 GMThttp://www.aygfsteel.com/xcp/archive/2011/06/05/351763.html


Link Source:    引进其它目源代?SOURCE)
New Source Folder: 新徏一个资源文件夹
Use as Source Folder: 使用源文件夹发布
         对应-->Remove from Build path(见图2)
Add External Archives: d外部档案
Add Libraries:  d库,引进其它公用jar(JAR)

Configure Build path: 配置构徏路径,可以动态 引进其它目(PROJECT)


source,jar,project




xcp 2011-06-05 02:04 发表评论
]]>
四、java的打包jar,war,ear包的作用Q区别,打包方式Q本文打jarQ?/title><link>http://www.aygfsteel.com/xcp/archive/2011/06/05/351761.html</link><dc:creator>xcp</dc:creator><author>xcp</author><pubDate>Sat, 04 Jun 2011 17:44:00 GMT</pubDate><guid>http://www.aygfsteel.com/xcp/archive/2011/06/05/351761.html</guid><wfw:comment>http://www.aygfsteel.com/xcp/comments/351761.html</wfw:comment><comments>http://www.aygfsteel.com/xcp/archive/2011/06/05/351761.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/xcp/comments/commentRss/351761.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/xcp/services/trackbacks/351761.html</trackback:ping><description><![CDATA[<p style="text-indent: -21pt; margin: 0cm 0cm 0pt 21pt; mso-char-indent-count: 0; mso-list: l0 level1 lfo1" class="MsoListParagraph"><font face="Calibri"><span style="mso-bidi-font-family: 宋体; mso-bidi-theme-font: minor-fareast" lang="EN-US"><span style="mso-list: Ignore">一?/span></span><span lang="EN-US">java</span></font><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">的打?/span><span lang="EN-US"><font face="Calibri">jar,war,ear</font></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">包的作用Q区别,打包方式</span><span lang="EN-US"><font face="Calibri">.</font></span></p> <p style="text-indent: -21pt; margin: 0cm 0cm 0pt 42pt; mso-char-indent-count: 0; mso-list: l0 level2 lfo1" class="MsoListParagraph"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin" lang="EN-US"><span style="mso-list: Ignore"><font face="Calibri">a)</font><span style="font: 7pt 'Times New Roman'">         </span></span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">作用与区?/span></p> <p style="text-indent: -63pt; margin: 0cm 0cm 0pt 63pt; mso-char-indent-count: 0; mso-list: l0 level3 lfo1; mso-text-indent-alt: -21.0pt" class="MsoListParagraph"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin" lang="EN-US"><span style="mso-list: Ignore"><span style="font: 7pt 'Times New Roman'">                         </span><font face="Calibri">i.</font><span style="font: 7pt 'Times New Roman'">              </span></span></span><span lang="EN-US"><font face="Calibri">jar: </font></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">通常是开发时要引用通用</span><span lang="EN-US"><font face="Calibri">(JAVA)</font></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">c,打成包便于存攄?/span></p> <p style="text-indent: -63pt; margin: 0cm 0cm 0pt 63pt; mso-char-indent-count: 0; mso-list: l0 level3 lfo1; mso-text-indent-alt: -21.0pt" class="MsoListParagraph"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin" lang="EN-US"><span style="mso-list: Ignore"><span style="font: 7pt 'Times New Roman'">                       </span><font face="Calibri">ii.</font><span style="font: 7pt 'Times New Roman'">              </span></span></span><span lang="EN-US"><font face="Calibri">war: </font></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">是做好一?/span><span lang="EN-US"><font face="Calibri">(web)</font></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">应用后,通常是网站,打成包部|到容器?/span></p> <p style="text-indent: -63pt; margin: 0cm 0cm 0pt 63pt; mso-char-indent-count: 0; mso-list: l0 level3 lfo1; mso-text-indent-alt: -21.0pt" class="MsoListParagraph"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin" lang="EN-US"><span style="mso-list: Ignore"><span style="font: 7pt 'Times New Roman'">                      </span><font face="Calibri">iii.</font><span style="font: 7pt 'Times New Roman'">              </span></span></span><span lang="EN-US"><font face="Calibri">ear: </font></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">企业U应用,实际?/span><span lang="EN-US"><font face="Calibri">EAR</font></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">包中包含</span><span lang="EN-US"><font face="Calibri">WAR</font></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">包和几个企业U项目的配置文g而已Q一般服务器选择</span><span lang="EN-US"><font face="Calibri">WebSphere</font></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">{,都会使用</span><span lang="EN-US"><font face="Calibri">EAR</font></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">包。通常?/span><span lang="EN-US"><font face="Calibri">EJB</font></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">打成</span><span lang="EN-US"><font face="Calibri">ear</font></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">包?/span></p> <p style="text-indent: -21pt; margin: 0cm 0cm 0pt 42pt; mso-char-indent-count: 0; mso-list: l0 level2 lfo1" class="MsoListParagraph"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin" lang="EN-US"><span style="mso-list: Ignore"><font face="Calibri">b)</font><span style="font: 7pt 'Times New Roman'">         </span></span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">打包方式</span></p> <p style="text-indent: -63pt; margin: 0cm 0cm 0pt 63pt; mso-char-indent-count: 0; mso-list: l0 level3 lfo1; mso-text-indent-alt: -21.0pt" class="MsoListParagraph"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin" lang="EN-US"><span style="mso-list: Ignore"><span style="font: 7pt 'Times New Roman'">                         </span><font face="Calibri">i.</font><span style="font: 7pt 'Times New Roman'">              </span></span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">所有的包都是用</span><span lang="EN-US"><font face="Calibri">jar</font></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">打的Q只不过目标文g的扩展名不一?/span></p> <p style="text-indent: -63pt; margin: 0cm 0cm 0pt 63pt; mso-char-indent-count: 0; mso-list: l0 level3 lfo1; mso-text-indent-alt: -21.0pt" class="MsoListParagraph"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin" lang="EN-US"><span style="mso-list: Ignore"><span style="font: 7pt 'Times New Roman'">                       </span><font face="Calibri">ii.</font><span style="font: 7pt 'Times New Roman'">              </span></span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">也可以用</span><span lang="EN-US"><font face="Calibri">Ant</font></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">来安成构?/span></p> <p style="text-indent: -21pt; margin: 0cm 0cm 0pt 42pt; mso-char-indent-count: 0; mso-list: l0 level2 lfo1" class="MsoListParagraph"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin" lang="EN-US"><span style="mso-list: Ignore"><font face="Calibri">c)</font><span style="font: 7pt 'Times New Roman'">         </span></span></span><span style="font-family: 'simsun','serif'; mso-bidi-font-size: 10.5pt" lang="EN-US">JET</span><span style="font-family: 宋体; mso-ascii-font-family: simsun; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: simsun; mso-bidi-font-size: 10.5pt">~译?/span><span style="font-family: 'simsun','serif'; mso-bidi-font-size: 10.5pt" lang="EN-US">EXE</span></p> <p style="text-indent: -63pt; margin: 0cm 0cm 0pt 63pt; mso-char-indent-count: 0; mso-list: l0 level3 lfo1; mso-text-indent-alt: -21.0pt" class="MsoListParagraph"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin" lang="EN-US"><span style="mso-list: Ignore"><span style="font: 7pt 'Times New Roman'">                         </span><font face="Calibri">i.</font><span style="font: 7pt 'Times New Roman'">              </span></span></span><span lang="EN-US"><font face="Calibri">JET<span style="mso-spacerun: yes">   </span></font></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">是要用钱买的Q而且据说</span><span lang="EN-US"><font face="Calibri"><span style="mso-spacerun: yes">   </span>JET<span style="mso-spacerun: yes">   </span></font></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">也不是能把所有的</span><span lang="EN-US"><font face="Calibri"><span style="mso-spacerun: yes">   </span>Java<span style="mso-spacerun: yes">   </span></font></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">E序都编译成执行文gQ性能也要打些折扣。所以,使用制作可执?/span><span lang="EN-US"><font face="Calibri"><span style="mso-spacerun: yes">   </span>JAR<span style="mso-spacerun: yes">   </span></font></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">文g包的Ҏ是最佳选择了,何况它还能保?/span><span lang="EN-US"><font face="Calibri"><span style="mso-spacerun: yes">   </span>Java<span style="mso-spacerun: yes">   </span></font></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">的跨q_Ҏ?/span></p><br /><br />二、实?br /><br />Ҏ一Q我现在有test/A.java<br />    道理虽然单,但是在这q程中还是有很多l节需要注意的Q哪一个细节注意不刎ͼ操作都不会成功?br /> <div align="center"> <div style="border-bottom: #cccccc 1px solid; border-left: #cccccc 1px solid; padding-bottom: 4px; background-color: #eeeeee; padding-left: 4px; width: 98%; padding-right: 5px; font-size: 13px; word-break: break-all; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; padding-top: 4px"> <div align="left"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #0000ff">package</span><span style="color: #000000"> test;<br /></span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> A{<br />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> main(String args[]){<br />        System.out.println(</span><span style="color: #000000">"</span><span style="color: #000000">test java</span><span style="color: #000000">"</span><span style="color: #000000">);<br />    }<br />}</span></div></div></div>    写好后,保存为A.javaQ存在D:\Java\jdk1.6\test_jar\test\目录下面Q打开cmdQ进入这个目录,即D:\Java\jdk1.6\test_jar\test\然后用javac命o~译Q会生成一个A.class文gQ此时类的编写工作已l完成?br /><br />    2Q在D:\Java\jdk1.6\test_jar目录下新Z个文件夹META-INFQ再新徏mainclass.mf文gQ在其中写入下面一行信?br />    Main-Class: com/hp/HelloWorld<br />    q一句有两个注意的地方,首先行尾要有回R换行Q其?#8220;:”?#8220;com”之间要有一个空根{?br />    q一行信息的作用是标明主cR?br /><br />    3Q最后就是生成jar包ƈ试了,在cmd中进入D:\Java\jdk1.6\test_jar目录Q输入下列命?nbsp;   <br />    jar cvfm test.jar META-INF/mainclass.mf test/A.class(<strong>q是指定文gQ当然也可以test指向文g?<br /></strong>    上述命o执行成功的话Q会提示“标明清单QmanifestQ?..”Q?br />    然后再在当前目录下输入java -jar test.jar 命oQ可以看?#8220;test java”?nbsp;<br /> <br /><br /><br />Ҏ二:<br />    用简单的jar -cvf test.jar    test目录,jar会自动生成META-INF/mainclass.mfQ我们只需要在里面d一?nbsp;Main-Class: com/hp/HelloWorld<br />可以了<br /><br /><br /><br />Ҏ三:myeclipse工具 Q?strong>推荐</strong>Q?br />    叛_目--Export--Jar File-要选择Main-Class<br /><br />Ҏ四:ant <br /><br /><br /><br /><br />同理Qwar包的构徏Ҏ也可以通过jar,myeclipse,ant来构?img src ="http://www.aygfsteel.com/xcp/aggbug/351761.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/xcp/" target="_blank">xcp</a> 2011-06-05 01:44 <a href="http://www.aygfsteel.com/xcp/archive/2011/06/05/351761.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>二、Java的应用服务安?/title><link>http://www.aygfsteel.com/xcp/archive/2011/06/05/351759.html</link><dc:creator>xcp</dc:creator><author>xcp</author><pubDate>Sat, 04 Jun 2011 17:35:00 GMT</pubDate><guid>http://www.aygfsteel.com/xcp/archive/2011/06/05/351759.html</guid><description><![CDATA[<p style="text-indent: -21pt; margin: 0cm 0cm 0pt 21pt; mso-char-indent-count: 0; mso-list: l0 level1 lfo1" class="MsoListParagraph"><font face="Calibri"><span style="mso-bidi-font-family: 宋体; mso-bidi-theme-font: minor-fareast" lang="EN-US"><span style="mso-list: Ignore">一?/span></span><span lang="EN-US">Java</span></font><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">的应用服务安?/span></p> <p style="text-indent: -21pt; margin: 0cm 0cm 0pt 42pt; mso-char-indent-count: 0; mso-list: l0 level2 lfo1" class="MsoListParagraph"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin" lang="EN-US"><span style="mso-list: Ignore"><font face="Calibri">a)</font><span style="font: 7pt 'Times New Roman'">         </span></span></span><span lang="EN-US"><font face="Calibri">Tomcat5,6,7</font></span></p> <p style="text-indent: -21pt; margin: 0cm 0cm 0pt 42pt; mso-char-indent-count: 0; mso-list: l0 level2 lfo1" class="MsoListParagraph"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin" lang="EN-US"><span style="mso-list: Ignore"><font face="Calibri">b)</font><span style="font: 7pt 'Times New Roman'">         </span></span></span><font face="Calibri"><span style="letter-spacing: 0.4pt" lang="EN-US">Bea </span><span lang="EN-US">Weblogic8,9,10</span></font></p> <p style="text-indent: -21pt; margin: 0cm 0cm 0pt 42pt; mso-char-indent-count: 0; mso-list: l0 level2 lfo1" class="MsoListParagraph"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin" lang="EN-US"><span style="mso-list: Ignore"><font face="Calibri">c)</font><span style="font: 7pt 'Times New Roman'">         </span></span></span><span lang="EN-US"><font face="Calibri">IBM Websphere</font></span></p> <p style="text-indent: -21pt; margin: 0cm 0cm 0pt 42pt; mso-char-indent-count: 0; mso-list: l0 level2 lfo1" class="MsoListParagraph"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin" lang="EN-US"><span style="mso-list: Ignore"><font face="Calibri">d)</font><span style="font: 7pt 'Times New Roman'">         </span></span></span><span lang="EN-US"><font face="Calibri">JBoss</font></span></p> <p style="text-indent: -21pt; margin: 0cm 0cm 0pt 42pt; mso-char-indent-count: 0; mso-list: l0 level2 lfo1" class="MsoListParagraph"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin" lang="EN-US"><span style="mso-list: Ignore"><font face="Calibri">e)</font><span style="font: 7pt 'Times New Roman'">         </span></span></span><span lang="EN-US"><font face="Calibri">Apusic Application Server</font></span></p> <p style="text-indent: -21pt; margin: 0cm 0cm 0pt 42pt; mso-char-indent-count: 0; mso-list: l0 level2 lfo1" class="MsoListParagraph"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin" lang="EN-US"><span style="mso-list: Ignore"><font face="Calibri">f)</font><span style="font: 7pt 'Times New Roman'">          </span></span></span><span lang="EN-US"><font face="Calibri">Sun Application Server</font></span></p> <p style="text-indent: -21pt; margin: 0cm 0cm 0pt 42pt; mso-char-indent-count: 0; mso-list: l0 level2 lfo1" class="MsoListParagraph"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin" lang="EN-US"><span style="mso-list: Ignore"><font face="Calibri">g)</font><span style="font: 7pt 'Times New Roman'">         </span></span></span><span lang="EN-US"><font face="Calibri">Oracle </font></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin">?/span><span lang="EN-US"><font face="Calibri"> Oracle9i/AS</font></span></p><img src ="http://www.aygfsteel.com/xcp/aggbug/351759.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/xcp/" target="_blank">xcp</a> 2011-06-05 01:35 <a href="http://www.aygfsteel.com/xcp/archive/2011/06/05/351759.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>三、Java的插件安装方式,插g开发,常插Ӟ快捷?/title><link>http://www.aygfsteel.com/xcp/archive/2011/06/05/351760.html</link><dc:creator>xcp</dc:creator><author>xcp</author><pubDate>Sat, 04 Jun 2011 17:35:00 GMT</pubDate><guid>http://www.aygfsteel.com/xcp/archive/2011/06/05/351760.html</guid><description><![CDATA[     摘要: MyEclipse常用快捷?插g大全 Q?QCtrl+M切换H口的大(2QCtrl+Q跛_最后一ơ的~辑处(3QF2当鼠标放在一个标记处出现Tooltip时候按F2则把鼠标Ud时Tooltipq会昄即Show Tooltip Description?nbsp;         F3跛_声明或定义的地方...  <a href='http://www.aygfsteel.com/xcp/archive/2011/06/05/351760.html'>阅读全文</a><img src ="http://www.aygfsteel.com/xcp/aggbug/351760.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/xcp/" target="_blank">xcp</a> 2011-06-05 01:35 <a href="http://www.aygfsteel.com/xcp/archive/2011/06/05/351760.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>一、Java的开发环境安装;环境变量配置(?http://www.aygfsteel.com/xcp/archive/2011/06/05/351758.htmlxcpxcpSat, 04 Jun 2011 17:34:00 GMThttp://www.aygfsteel.com/xcp/archive/2011/06/05/351758.html一?/span>Java的开发环境安装;环境变量配置(?/span>)



xcp 2011-06-05 01:34 发表评论
]]>
վ֩ģ壺 | | ¡| п| | | ɳ| ˮ| | | | ˮ| | | | е| | Т| | ԫ| | Ҵ| ɽ| ɽ| | ɽ| ƽ| | Ӽ| | ľ˹| Ӽ| | Ʊ| ʲ| | | | °| | ͼʲ|