[Biojava-l] pdbtoXML in Linux and JRE,SE

Matthew Pocock matthew_pocock@yahoo.co.uk
Sat, 16 Nov 2002 15:16:31 +0000


Hi Jon,

When running java classes, you should not add a .java extention to the 
class name. Typing "java pdbtoXML.java" trys to find a class called 
pdbtoXML.java rather than one named pdbtoXML.

Try putting the following code into a file named PDBConverter.java :

import java.io.*;
import org.biojava.bio.program.*;

public class PDBConverter {
   public static void main(String[] args)
   throws Exception {
     StringBuffer sbuf = new StringBuffer();
     BufferedReader in = new BufferedReader(
       new FileReader(
         new File(args[0]) ) );

     for(
       String line = in.readLine();
       line != null;
       line = in.readLine()
     ) {
       sbuf.append(line);
     }

     PdbToXMLConverter converter =
       new PdbToXMLConverter(sbuf.toString());

     converter.convert();
   }
}

To compile this, put biojava.jar and the current directory into your 
CLASSPATH environment variable, and type:

javac PDBConverter.java

If this works, then you can run the app by typing:

java PDBConverter

I've just typed the code into this mail editor, so it may not work first 
time.

Good luck

Matthew

-- 
BioJava Consulting LTD - Support and training for BioJava
http://www.biojava.co.uk

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com