[Biojava-l] Error with VisualJ++

Thomas Down td2@sanger.ac.uk
Mon, 10 Dec 2001 12:46:27 +0000


On Mon, Dec 10, 2001 at 11:38:25AM +0200, Petri Pehkonen wrote:
> Hello,
> 
> I've made a Blast report parser with Java. There is little problems with
> executing the code with Microsoft Visual J++. The same code works well
> when I execute it with JBuilder, but in Visual J++ I get a
> NoClassDefFoundError -exception. So I've added needed jar-files to
> classpath (biojava,bytecode,xerces) and both tools (JBuilder & VisualJ++)
> build the program well. The only problem is, that the command "new
> BlastLikeSAXParser();" affects an exception (see below). Could anybody
> tell me what's wrong? 
> 
> try {
> oParser = (org.xml.sax.XMLReader) new BlastLikeSAXParser();
> } catch (java.lang.NoClassDefFoundError ee)
> {
> richEdit1.setText ("Error: I get this all the time in Visual J++");
> }


Hmmm, I can't see all that much which can go wrong in
the BlastLikeSAXParser constructor.  The two possibilities
are:

  - Can't access XML-parser classes (but you say you have
    xerces.jar on the classpath, so this /shouldn't/ be an
    issue).

  - The collections API isn't available.  If, as Mark says,
    J++ only supports Java 1.1, this is likely.  You could try
    compiling/running the following short program:


import java.util.*;

public class Test {
    public static void main(String[] args) {
        Map m = new HashMap();
        m.put("foo", "bar");
    }
}



If this compiles successfully, then we should maybe look
again.


  Thomas (who's never really got this IDE thing -- emacs
          and command line for me...)