2008年6月29日 星期日

ant

like makefile

use xml

create a file called build.xml.  Then run ant.  Then the project is compiled 
( ant -verbose will print more information)

the top level element is project, its default attribute decides which target to do
ex:
<project name="Test"  default="compile">

the target's depends property decides what targets must be done before it
ex:
<target name="compile"  depends="init>

how to run ant:
1. ant  
   this will execute default target
2. ant  targetName

show information about build.xml
ant -projecthelp
show the targets with their description
( the description is described by description property of each target)

some useful tasks:
1. javac  srcdir="src", destdir="bin"
compile java codes

2.  <echo>hello</echo>
print message when running ant 

3, <mkdir  dir="test/bin"/>

4. <jar  destfile="dist/test.jar"  basedir="bin" />

5. <delete dir="bin" />

6. <java classname="Test.Main"  classpath="bin">
    <arg value="peter"/>
    <arg value="andy"/>
   <arg file="."/>
   </java>

2008年6月25日 星期三

jh.jar, jmf.jar

javax.help  package is in jh.jar

javax.media package is in jmf.jar

2008年6月24日 星期二

System.getProperty

ex:
System.getProperty("java.library.path")

2008年6月18日 星期三

export jar on jbuilder 2007

(1) when export:
      choose src folder of each project
     check:
     Export all output folders for checked projects
     add directory entries

2008年6月17日 星期二

manifest

set main class for jar

syntax:
ex:
manifest.txt

Main-Class: test.MainApp

2008年6月16日 星期一

jar

when creating jar, the package directory is created according to your command
Hence, if you want the class in test package , you must use
jar  cvmf  manifest.txt  test 

If  test is in another directory , and you use
jar cvmf  manifest.txt  ../test
It will create test directory below  ..  directory,  so it can not find test/*.class