Bookmark this site!

2005-12-26

ant javac Xlint:unchecked

You are porting your code to Java 5.0 (aka 1.5); building your project under Xcode gives the following notes from javac:

[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
This raises the following question:
Q: How do I pass -Xlint:unchecked to an ant javac task?
A: Edit the relevant target in your build.xml file to add an embedded compilerarg entry, to the javac task:
<compilerarg value="-Xlint:unchecked"/>
or
<compilerarg value="-Xlint"/>
so it reads something like this:
<target name="compile" description="Compile code">
       <mkdir dir="${bin}"/>
       <mkdir dir="${lib}"/>
       <javac srcdir="${src}" destdir="${bin}" 
              includeAntRuntime="no" 
              classpathref="lib.path" 
              debug="${compile.debug}">
           <compilerarg value="-Xlint"/>
       </javac>
</target>
Using "-Xlint" enables all recommended Xlint options, including :unchecked. See the Sun javac documentation (scroll down to Xlint) for details of other options, giving finer control if you need it.

2005-12-09

Installing the University Certificate

The EUCS site gives complex instructions for installing the University Certificate on MacOSX for use with Safari.

Now Apple have made this simple:

  1. Download the Edinburgh CA Certificate.
  2. Open (double-click) the certificate in the finder. This should launch Keychain Access and take you through a dialog to install the certificate.
  3. Install the Certificate in your X509 Anchors keychain.