How to add to java classpath?

I am wondering how to add/implement to java classpath. I think I might be missed out the classpath thing so my program doesn't work. I keep getting error message like: "cannot resolve symbol: method setDocumentHandler(BookCounter)" and warning messages like: "C:\Example\BookCounter.java :11: warning:org.xml.sax.HandlerBase in org.xml.sax has been deprecated." and "C:\Example\BookCounter.java :16: warning:org.xml.sax.HandlerBase in org.xml.sax has been deprecated."
If this is not because of classpath problem, kindly let me know what should I do?
My code as follow:-
========================
import java.io.*;
import org.xml.sax.*;
import org.xml.sax.HandlerBase;
import javax.xml.parsers.SAXParserFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
public class BookCounter extends HandlerBase
private int count = 0;
public static void main (String args[]) throws Exception
(new BookCounter()).countBooks();
public void countBooks() throws Exception
SAXParserFactory f = SAXParserFactory.newInstance();
SAXParser f2 = f.newSAXParser();
// Parser p = new com.jclark.xml.sax.Driver();
f2.setDocumentHandler(this);
f2.parse("file:///C:/books.xml");
public void startElement(String name) throws SAXException
if (name.equals("book"))
count++;
public void endDocument() throws SAXException
System.out.printIn("There are" + count + "books");

The errors don't look like classpath problems. The first one is a result of it not being able to find a method in BookCounter (or more likely HandlerBase) that has the signature that you are attempting to use.
The warnings come from the fact that HandlerBase has been deprecated, just like the messages state. In other words, it has been replaced by a newer version, or incorporated into another class' functionality. Check the API for more information.

Similar Messages

  • How to add new Java version to Java Preferences?

    Greetings,
    I know Java 7 is not officially supported, but I know it works.
    I built 1.70.jre and put it in /Library/Java/JavaVirtualMachines, but I do not know how to add to  Java Preferences.
    Does anyone know where the list of Java versions is stored and how to add a version to it?
    Thanks

    Fixing the permissions did not fix it.
    I think there  to be a record somewhere of what version are where. That is probably set if you use am installer which I do not have. I only have the file I copied there.
    I found out that typing this in Terminal...
    export JAVA_HOME=/Library/Java/1.7.jre/Contents/Home
    ...temporarily sets that version to the one being used, but it is only for that Terminal session, and it still does not show in Java Preferences.
    I need to know how to get it into Java Preferences. It might be some command I don't know.

  • How to add a Java file from ejbModule to EJBCandidates ?

    Hi,
    In my java client proxy project, I have got the EJBCandidates generated. But I need to add one more java source file from ejbModule to EJBCandidates.
    If I right click on the java file I need to add, am not getting that option for adding.
    <b>Please help me how to add java source file from ejbModule to the EJBCandidates.</b>
    Thank you.

    Great... :-)
    Thank you very very much xHacker :-)
    That what just what I needed.

  • How to add jar files  classpath in sun stdio creator

    Hi,
    i am using log4j-1.2.13.jar in my application.
    how to add it to my classpath in sun stdio.
    with regards
    shannu sarma

    Hi there,
    These threads will answer your question
    http://forum.sun.com/jive/thread.jspa?forumID=123&threadID=61842
    http://forum.sun.com/jive/thread.jspa?forumID=123&threadID=56060
    Thanks
    K

  • How to add new Java Instance to cluster in EHP1?

    I've installed the EHP1 (Beta 3.0) on a Windows 2003 box, and have figured out how to use the
    configtool to add server processes to the initially created Java Instance.
    What tool or process do I use to go the next step and add additional Java Instances to the cluster?
    Sorry if I've missed where the steps are already described, I've tried to find them.
    Walt

    Hi Dido.  Thanks for your pointer.
    When I started the installer, it gave me only the choice of the Developer Edition. Perhaps for this
    EHP1 Evaluation Version the Productive Edition is not yet available??
    The top line in the installer was "SAP Enhancement Package 1 for SAP NetWeaver CE 7.1 SDN
    Evaluation"
    The only next choice was "SAP NetWeaver CE Developer Edition"
    The two choices under this were "Custom Server Installation" and "Uninstall - SAP Systems or
    Single Instances".
    Will any of these choices allow me to add an additional Java Instance to the cluster?
    Thanks for your help ...
    Walt

  • How to add a java option in oas 10g 9.0.4?

    I need add a java option in my oas 10g...
    I have an application implemented with jdeveloper 10g (10.1.2) and its need to use other jdbc libraries acording:
    http://radio.weblogs.com/0118231/stories/2005/05/27/workaroundForDeployingAdf1012AppUsingIntermediaDomainsToOracleAs904.html
    Using EnterpriseManager, i add a java option for the OC4J instance where my ADF 10.1.2-based application will be deployed:
    [b]-Xbootclasspath/p: C:\oracle\infra\jdbc-10.1.0.4\ojdbc14.jar;C:\oracle\infra\jdbc-10.1.0.4\orai18n.jar
    but now, ths oc4j instance dont init
    ...my opmn.xml file contains:
    <process-type id="ADF_050615" module-id="OC4J">
    <module-data>
    <category id="start-parameters">
    <data id="java-options" value="-server -Xrs -Djava.security.policy=C:\oracle\infra\j2ee\ADF_050615\config\java2.policy -Djava.awt.headless=true
                             -Xbootclasspath/p: C:\oracle\infra\jdbc-10.1.0.4\ojdbc14.jar;C:\oracle\infra\jdbc-10.1.0.4\orai18n.jar"
                             />
    <data id="oc4j-options" value="-properties"/>
    </category>
    <category id="stop-parameters">
    <data id="java-options" value="-Djava.security.policy=C:\oracle\infra\j2ee\ADF_050615\config\java2.policy -Djava.awt.headless=true"/>
    </category>
    </module-data>
    </process-type>
    Help me please

    Rigoberto, there should be no space between "-Xbootclasspath/p:" and the path "C:\oracle\infra\jdbc-10.1.0.4\ojdbc14.jar;C:\oracle\infra\jdbc-10.1.0.4\orai18n.jar"
    By the way, one can always take a look at the logs at
      $ORACLE_HOME/opmn/logs
    especially those files whose names start with OC4J~ if there is some wrong with oc4j processes. Those files are the default oc4j stout and sterr. If oc4j can not init, there should be some kind of error message in them.
    By the way, the following line may be deleted since no property file is specified.
      <data id="oc4j-options" value="-properties"/>
    Hope this helps.

  • How to add a java library?

    Hello! Can some one help me on the following problem?
    I am writing a DOM parser and I need to print out the modified xml file. So I want to use the write funcition defined in the com.sun.xml.tree.XmlDocument library. But this package is NOT included in JAXP package. Where shall I get this om.sun.xml.tree.XmlDocument library?
    Any help is greatly appreciated.

    The com.sun.xml.tree.XMLDocument class is not part of JAXP. It is part of Sun's parser. It is bundled with Sun's JAXP package. You can download Sun's JAXP package from http://java.sun.com/xml/jaxp/index.jsp
    Thanks,
    Rashmi

  • How to add AS JAVA system in Solution Manager

    Hi all,
           we have installed Solution Manager, now i wanna add Enterprise portal sysyetm in SMSY.can anyone tel me the steps pls
    rgds,
    rajesh

    Hi,
    You can use <b>SAP Note 987835</b>.
    Regards,
    Stephan

  • How to add a java dialog instance to Java central instance of SAP CRM

    Hi Gys,
    I have installed a new dialog instance for the CRM Java landscape for the version 7.01 .
    CRM Abap instance is seperate and its data accessed by Jco connection by central instance but not dialog instance . Could you please let me know if any configuration steps to be followed.
    Thanks in advance
    Sudhakar

    Could you describe your problem a little bit more.
    I have installed a new dialog instance for the CRM Java landscape for the version 7.01 .
    CRM Abap instance is seperate
    Ok, sounds like 2 Java instances and one ABAP instance.
    and its data accessed by Jco connection by central instance but not dialog instance.
    This is where I get confused.
    Do you have one or more ABAP instances?
    What is your actual problem (what do you want to do)?

  • How to add used DCs in Netweaver 7.1 ??

    hi ,
                i want to add used Dc for EJB DC. I am having JAVA project which is having some java classes , which i want to use in EJB DC. How to add that JAVA DC as used DC for EJB DC in Netweaver 7.1????

    HI,
    Hope this may help u..
    Importing Development Configurations from the SLD
           1.      To obtain access to the development configurations in the SLD, set the Development Configuration Pool in the Developer Studio:
                                a.      From the menu path, choose Window  ® Preferences.
                                b.      Open Java Development Infrastructure ® Development Configuration Pool.
                                c.      Specify the URL of the server on which the SLD is installed in URL in the following format http:. Choose OK.
           2.      To import a development configuration, open the context menu in the Local DCs view and choose Import Configuration... 
           3.      Select the remote option.
    A dialog for logging on to the development infrastructureappears.
           4.      Enter USER1and the corresponding password.
    The Development Configuration Importdialog appears.
    In this dialog, you can set the storage location (the root folder) for the files created in this development configuration. To be able to change this setting, you must first remove all development configurations.
    A list of the development components available in the SLD appears.
           5.      Open the node TECHNO/1.0 and import the development configuration TECHNO_dev
    The extension dev stands for the development status of the SC. The APPLcons development configuration is also created. After development, you can maintain the consolidation state in this development configuration.
    The Development Configuration Import dialog appears.
           6.      Choose Next.
    The Build Variants dialog window appears.
           7.      Choose Finish.
    The system reads the development configuration settings and sets up your development environment. The views Active DCs, Inactive DCs, and Local DCs now contain a new entry with the name of the imported development configuration.
    Result
           1.      In the Development Configuration perspective, switch to the Inactive DCs view.
           2.      Open the folder TECHNO_dev.
    You can see only the software components which you will develop.
    DCs can be created only in the Inactive workspace and are activated in the CBS only by a successful build. This makes them available automatically in the Active workspace, where they can be used for the build of other DCs.
           3.      Switch to the Active DCs view.
           4.      Open the folder TECHNO_dev.
    Next to the software components you want to develop, you see three entries:
    ■       sap.com_SAP_BUILDT
    ■       sap.com_SAP_JTECHS
    ■       sap.com_SAP-JEE
    These SCs are provided and can be used but cannot be changed.

  • How to add a new j2ee server to PI system?

    how to add a new j2ee server for our PI product system?
    Is it to execute 'install dialog instance ' steps?
    Thanks

    Hello
    I have moved this thread to the Netweaver Administrator forum (this is not a PI technical issue). You have a better chance of getting a quality answer to your query in the Netweaver Administrator forum.
    Take the notes below into consideration after you have added the java node.
    1) #734931   Using a J2EE cluster in the XI 3.0/7.0 environment
    2) #1079478  Using a J2EE Cluster in the PI 7.10 environment
    Can anyone assist with how to add a java node?
    Regards
    Mark Smyth
    XI/PI Moderator

  • How to Add JAR files and Config files to CLASSPATH at runtime?

    QUERY:
    During runtime, I need to load the JAR files and relevant config files( .cfg files and .properties file) into CLASSPATH and run a specific java program from one of the JAR which is available in CLASSPATH.
    Please advise me any relevant Java API details or a sample java program to implement the above use case.
    Thanks in advance.

    During runtime, I need to load the JAR files and relevant config files( .cfg files and .properties file) into CLASSPATH and run a specific java program from one of the JAR which is available in CLASSPATH.
    Please advise me any relevant Java API details or a sample java program to implement the above use case.
    You don't add to YOUR classpath once your app is launched.
    You create a NEW process for the app you want to run and provide the proper environment for it to run in - including any PATH or CLASSPATH environment variables.
    The Java API for the ProcessBuilder class has a simple example that shows how to create the arguments and launch an external application.
    ProcessBuilder (Java Platform SE 7 )
    There are also PLENTY of other examples of using ProcessBuilder; just search the net.

  • How to add table in SAP Non interactive forms in webdynpro java

    Hi Experts,
    I have a requirement in webdynpro java.I have a print button.On clicking print button a pdf will be opened.
    This pdf will have data from the webdynpro view.I want to know how to add table in the adobe pdf.The webdynpro view will have many rows of table(rows will keep changing as per the size of the data output).How to send this data to adobe.How do we bind the node to the table in the adobe.How to automatically
    Please suggest.
    Thanks,
    Rajani
    Edited by: Rajani Nandagiri on Dec 26, 2008 8:58 AM

    Rajani,
    Take a look at below links, it will help you.
    [Handling Dynamic Length Tables in Adobe Forms|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e0859ad1-53aa-2a10-78ae-99e41c407669]
    [Integrate tables & Images in Adobe Web Dynpro|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/user-interface-technology/wd%20java/wdjava%20archive/dynamic%20non-interactive%20pdf%20form.pdf]
    [How to Handle Table Input and Output|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/user-interface-technology/wd%20java/7.0/adobe/how%20to%20handle%20table%20input%20and%20output.pdf]
    [How Tou2026deal with Table input and display in Interactive Forms|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00c4041d-188d-2910-6ea2-b4d5155f56e0]
    Chintan

  • Java.awt.Container.add(Container.java:345) how can i handle this

    dear all,
    i want to design an outlook for a chat applet. but this seems to tough as i am getting a run time error
    my code is:
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    import java.io.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    import java.io.*;
    import javax.swing.*;
    * the import that are required for this class
    public class outer extends Frame //implements ActionListener, Runnable
    private TextField txtusername,txtpassword,txtroomname;
    private Label lblusername,lblpassword,lblroomname,lbllistofrooms;
    Button okBtn,exitBut;
    Color backColor=null,btnBackClr=null,btnForeClr=null;
    String[] roomsavailable = {" one ", " two ", " three", " four"};
    private JList rooms = new JList(roomsavailable);
    /** the costructor*/
    public outer()
    { // super(st);
    backColor=new Color(200,200,255);
    btnBackClr=new Color(225,240,255);
    btnForeClr=new Color(205,205,205);
    setBackground(backColor);
    setLayout(null);
    lblusername = new Label("Username");
    lblusername.reshape(insets().left+5,insets().top+10,60,20);
    add(lblusername);
    txtusername=new TextField();
    txtusername.reshape(insets().left+75,insets().top+10,60,20);
    add(txtusername);
    lblpassword = new Label("Password");
    lblpassword.reshape(insets().left+5,insets().top+30,60,20);
    add(lblpassword);
    txtpassword=new TextField();
    txtpassword.reshape(insets().left+75,insets().top+30,60,20);
    add(txtpassword);
    lblroomname = new Label("Select Room");
    lblroomname.reshape(insets().left+5,insets().top+50,60,20);
    add(lblroomname);
    txtroomname=new TextField();
    txtroomname.reshape(insets().left+75,insets().top+50,60,20);
    add(txtroomname);
    okBtn=new Button("Login");
    okBtn.reshape(insets().left+25,insets().top+80,60,20);
    add(okBtn);
    // okBtn.addActionListener(this);
    exitBut=new Button("EXIT");
    exitBut.reshape(insets().left+50,insets().top+80,60,20);
    add(exitBut);
    // exitBut.addActionListener(this);
    public static void main(String[] args)
    // Create a JFrame
    JFrame frame = new JFrame("client side");
    // Create a outer class object
    outer outerobj = new outer();
    // Add the outer to the JFrame
    frame.getContentPane().add(outerobj, BorderLayout.WEST);
    // Set Jframe size
    frame.setSize(800, 400);
    //set resizable true
    frame.setResizable(true);
    // Set JFrame to visible
    frame.setVisible(true);
    // set the close operation so that the Application terminates when closed
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    when i compile it it compiles but gives run time error like this
    RUN TIME error:
    Exception in thread "main" java.lang.IllegalArgumentException: adding a window
    to a container
    at java.awt.Container.addImpl(Container.java:434)
    at java.awt.Container.add(Container.java:345)
    at outer.main(outer.java:75)
    Press any key to continue...
    i know erroe in this line
    frame.getContentPane().add(outerobj, BorderLayout.WEST);
    but how shall i add to get the proper layout by getting benifit of insets method
    reply soon
    please

    You can't add a frame to a frame.
    Try chaing the class definition from
    public class outer extends Frameto
    public class outer extends PanelPlease note to format your code (you'll get a faster response) use [ code]
    Object names should always start with a capital letter. outer --> Outer

  • How to add an image to an IMAGE control in Java WebDynpro

    hi
    How to add an image to an IMAGE control in Java WebDynpro.
    Please give me the steps to assign an image to an IMAGE control.
    Advanced Thanks
    brahma

    Thank You Mathan MP,
    i tried these steps, but whenever i selected the source property of image UI control, it opens a context window, but this context window does't contain any thing for selection.
    so how to solve this problem ?
    the link whatever u provided is not opened, please send the correct link.
    http://127.0.0.1:1284/help/index.jsp?topic=/com.sap.devmanual.doc.user/f3/1a61a9dc7f2e4199458e964e76b4ba/content.htm
    Thanks in Advance
    brahma

Maybe you are looking for

  • Cannot print a web page since recent update to Apple Snow Leopard

    After recent update to Mac OS 10.6.4 I cannot print any page when using Firefox. I tried using Apple Safari and there was no problem == This happened == Every time Firefox opened == After recent update to Mac OS 10.6.4

  • Logical and Physical Standby Practice

    Hello Gurus I am now attempting to practice Oracle Data Guard and in this direction I understand since 10g we have logical standby server as well as a physical standby server. While I am gathering information and knowledge about the data guard as is

  • Edit in Photoshop Elements 9 from Lightroom 3 on a Mac

    I can't seem to get the PS9 to open properly with my photo.  So I'm in LR3 and I right click and select 'edit in photoshop elements 9'.  It asks me if I want to 'edit a copy with lightroom adjustments' - I say yes and click 'edit'. PS9 opens and I se

  • Wish list in next version: Curves. It's Missing.

    Hello, I purchased Aperture and like many attributes of the software. Great job! I would like to see Curves in the next version. I know I can go to adjust in Curves in Photoshop, but that will covert the RAW image into a .tif or .psd which takes up m

  • Using the LAG function

    Hi all, using: Oracle9i Enterprise Edition Release 9.0.1.3. I have a table that looks basically like this: SQL> select labour_rate_id, organisation_id, commence_date_time, termination_date_time, labour_rate   2    from labour_rate   3  where organisa