Monday, January 19, 2009

Getting java to work with firefox 3 on solaris 10

Q: Why is it all java-related things never work right on Solaris?
A: The people at Sun use Macs

Create a symbolic link to your java's
(do not copy this file, it will not work properly)

sudo ln -s /usr/jdk/jdk/jre/plugin/i386/ns7/ \

(this is where I put my java 6 installation - your location is probably different

Friday, January 16, 2009

XMLTree.c:1016: error: void value not ignored as it ought to be

Normally I don't recommend trying to alter code when an installation throws an error - the problem is usually user-related (i.e. me) or totally unfixable. This is one exception:

If you get this error trying to install the R XML library from Omegahat

XMLTree.c: In function `xmlBufferWrite':
XMLTree.c:1016: error: void value not ignored as it ought to be
*** Error code 1
make: Fatal error: Command failed for target `XMLTree.o'

Don't give up. It is actually worth fixing this one.

Expand the tarball and alter the file called 'XMLTree.c'

gunzip XML_1.99-0.tar.gz
tar -xvf XML_1.99-0.tar
rm XML_1.99-0.tar
emacs XML/src/XMLTree.c

The offending code:


/* These two taken from libxml2-2.6.27
They are needed if xmlOutputBufferCreateBuffer()
is not in the installed libxml2.
It appeared in libxml2-2.6.23, released on Jan 5 2006
static int
xmlBufferWrite (void * context, const char * buffer, int len) {
int ret;

ret = xmlBufferAdd((xmlBufferPtr) context, (const xmlChar *) buffer, len);
if (ret != 0)

xmlOutputBufferCreateBuffer(xmlBufferPtr buffer,
xmlCharEncodingHandlerPtr encoder) {
xmlOutputBufferPtr ret;

if (buffer == NULL) return(NULL);

ret = xmlOutputBufferCreateIO((xmlOutputWriteCallback)
NULL, (void *) buffer, encoder);



Notice the disclaimer - if your libxml2 is up to date these methods are not necessary anyway.
So just delete those two methods and the directive they rode in on, from #ifdef to #endif

tar -cvf XML_1.99-0.tar XML
gzip XML_1.99-0.tar

and install
R CMD INSTALL XML_1.99-0.tar.gz