Branch target offset too large for short
I was trying to compile a rather large XSLT file using the built-in Java 1.5.x libraries, and ran into the following error:
Branch target offset too large for short
Seems that this is a bug in the version of Xalan that ships with Java (or maybe a bug in the XSLTC sub-component, I'm not exactly sure).
After spending a few hours googling and tweaking my code to try to work around this bug, I finally downloaded Saxon, put saxon.jar in my project classpath, and that fixed the problem. I used Saxon-B 9.1.
Posted by rickg ( Jul 24 2008, 10:57:22 PM PDT ) Permalink Comments [0]Accessing a Java resource as a file
Here is some quick and dirty code to get access to a resource on the class path as a File object:
URL url = this.getClass().getResource("/the-file.txt");
URI uri = new URI(url.toExternalForm());
File f = new File(uri);
Obviously replace "/the-file.txt" with the actual path to the resource. Note: this is the path on the "class path", not the file system.
Posted by rickg ( Jun 10 2008, 10:55:38 AM PDT ) Permalink Comments [0]
