Help with compiler...javac

Help
Fabio RAM
2006-08-15
2013-01-13
  • Fabio RAM

    Fabio RAM - 2006-08-15

    Hi Folks,

    I can't compile the tutorial PageViewCountData.class with some modifications.
    I'm using the default example PageViewCountData.class (from cewolfexample-1.0.war) to provide the tutorial graph. 
    And PageViewCountData.class from cewolfexample-1.0.war example works fine and i'm the using package library
    from cewolfexample-1.0.war.
    My cewolf dir:
    machine:/opt/tomcat4/jakarta-tomcat-4.1.24/webapps/myapp/cewolf

    My lib directory is: 
    Everithing on tutorial was did include the copy of jar files to my WEB-INF/lib 

    machine:/opt/tomcat4/jakarta-tomcat-4.1.24/webapps/myapp/WEB-INF/lib# ls 
    classes12.zip.old servlet.jar 
    batik-awt-util-1.6.jar cewolf-1.0-bundle-2.jar commons-fileupload-1.0.jar teste.sh 
    batik-dom-1.6.jar cewolf-1.0.jar commons-logging-1.0.4.jar 
    batik-svggen-1.6.jar classes12.jar jcommon-1.0.0.jar 
    batik-util-1.6.jar classes12.jar.old jfreechart-1.0.0.jar 
    batik-xml-1.6.jar classes12.zip ojdbc14.jar xmlparserv2.jar 
    machine:/opt/tomcat4/jakarta-tomcat-4.1.24/webapps/myapp/WEB-INF/lib# 

    My classes dir is:

    machine:/opt/tomcat4/jakarta-tomcat-4.1.24/webapps/myapp/WEB-INF/classes/de/laures/cewolf/example# ll 
    total 66 
    -rw-r--r-- 1 root sys 1167 Aug 10 11:57 ConnectionFactory.class 
    -rw-r--r-- 1 root sys 1662 Aug 10 11:56 ConnectionFactory.java 
    -rw-r--r-- 1 root sys 1011 Aug 2 18:58 ExtraTitleEnhancer.class 
    -rw-r--r-- 1 root sys 1062 Aug 2 18:58 HighLowDatasetProducer.class 
    -rw-r--r-- 1 root sys 1151 Aug 2 18:58 PageViewCountData$1.class 
    -rw-r--r-- 1 root sys 4013 Aug 2 18:58 PageViewCountData.class 
    -rw-r--r-- 1 root sys 4013 Aug 10 11:58 PageViewCountData.class_bak 
    -rw-r--r-- 1 root sys 6482 Aug 10 15:59 PageViewCountData.java 
    -rw-r--r-- 1 root sys 5321 Aug 2 18:58 ParamBean.class 
    -rw-r--r-- 1 root sys 2874 Aug 2 18:58 RandomXYData.class 

    So based on the same structure that i described on last post i tried to compile a new PageViewCountData.java and i had this: 

    machine:/opt/tomcat4/jakarta-tomcat-4.1.24/webapps/myapp/WEB-INF/classes/de/laures/cewolf/example#javac -deprecation PageViewCountData.java 

    PageViewCountData.java:24: package org.jfree.data does not exist 
    import org.jfree.data.CategoryDataset; 

    PageViewCountData.java:25: package org.jfree.data does not exist 
    import org.jfree.data.DefaultCategoryDataset; 

    PageViewCountData.java:26: package de.laures.cewolf does not exist 
    import de.laures.cewolf.DatasetProduceException; 

    PageViewCountData.java:27: package de.laures.cewolf does not exist 
    import de.laures.cewolf.DatasetProducer; 

    PageViewCountData.java:28: package de.laures.cewolf does not exist 
    import de.laures.cewolf.CategoryItemLinkGenerator; 

    PageViewCountData.java:29: package org.apache.commons.logging does not exist 
    import org.apache.commons.logging.Log; 

    PageViewCountData.java:30: package org.apache.commons.logging does not exist 
    import org.apache.commons.logging.LogFactory; 

    PageViewCountData.java:31: package org.jfree.chart.entity does not exist 
    import org.jfree.chart.entity.CategoryItemEntity; 

    PageViewCountData.java:32: package org.jfree.chart.tooltips does not exist 
    import org.jfree.chart.tooltips.CategoryToolTipGenerator; 

    PageViewCountData.java:50: cannot resolve symbol 
    symbol : class DatasetProducer 
    location: class examples.PageViewCountData 
    public class PageViewCountData implements DatasetProducer, CategoryToolTipGenerator, CategoryItemLinkGenerator, Serializable { 

    PageViewCountData.java:50: cannot resolve symbol 
    symbol : class CategoryToolTipGenerator 
    location: class examples.PageViewCountData 
    public class PageViewCountData implements DatasetProducer, CategoryToolTipGenerator, CategoryItemLinkGenerator, Serializable { 

    PageViewCountData.java:50: cannot resolve symbol 
    symbol : class CategoryItemLinkGenerator 
    location: class examples.PageViewCountData 
    public class PageViewCountData implements DatasetProducer, CategoryToolTipGenerator, CategoryItemLinkGenerator, Serializable { 

    PageViewCountData.java:55: cannot resolve symbol 
    symbol : class Logger 
    location: class examples.PageViewCountData 
    Logger log = Logger.getLogger(PageViewCountData.class); 

    PageViewCountData.java:65: cannot resolve symbol 
    symbol : class DatasetProduceException 
    location: class examples.PageViewCountData 
    public Object produceDataset(Map params) throws DatasetProduceException { 

    They found no packages that i put on lib directory 
    machine:/opt/tomcat4/jakarta-tomcat-4.1.24/webapps/myapp/WEB-INF/lib# 

    Can anyone help me with this? 

    Best Regards
    Fabio Ram

     
    • Zoltan Luspai

      Zoltan Luspai - 2006-08-15

      Hi,

      You should put the libs on the classpath for the javac, otherwise it wont find it. Use javac -cp <path> or set the CLASSPATH variable to ; separated paths pointing to the jars. The web-inf/lib is only automatically used by web containers like tomcat ...
      Zoltan

       
    • Fabio RAM

      Fabio RAM - 2006-08-16

      Thanks Again Zoltan for your help.

      My PageViewCountData.java references packages like this:

      package de.laures.cewolf.examples;
      import java.lang.*;
      import java.sql.*;
      import java.io.*;
      import java.util.*;
      import java.text.SimpleDateFormat;
      import java.util.Date;
      import java.util.Map;
      import java.io.Serializable;
      import javax.sql.*;
      import org.jfree.data.category.CategoryDataset;
      import org.jfree.data.category.DefaultCategoryDataset;
      import de.laures.cewolf.DatasetProduceException;
      import de.laures.cewolf.DatasetProducer;
      import de.laures.cewolf.links.CategoryItemLinkGenerator;
      //import de.laures.cewolf.CategoryItemLinkGenerator;
      import org.apache.commons.logging.Log;
      import org.apache.commons.logging.LogFactory;
      import org.jfree.chart.entity.CategoryItemEntity;
      import org.jfree.chart.tooltips.CategoryToolTipGenerator;
      import org.apache.log4j.Logger;

      I tried to compile my code using the libs from cewolfexample-1.0.war:

      batik-awt-util-1.6.jar
      batik-dom-1.6.jar
      batik-svggen-1.6.jar
      batik-util-1.6.jar
      batik-xml-1.6.jar
      cewolf-1.0.jar
      commons-logging-1.0.4.jar
      crimson-1.1.3.jar
      gnujaxp-1.0.0.jar
      jcommon-1.0.0.jar
      jfreechart-1.0.0.jar
      jfreechart-demo-1.0.0.jar
      log4j-1.2.12.jar

      Look my CLASSPATH :
      machine:/opt/tomcat4/jakarta-tomcat-4.1.24/webapps/cadastro/example_cewolf/WEB-INF# echo $CLASSPATH
      :/opt/tomcat4/jakarta-tomcat-4.1.24/webapps/cadastro/example_cewolf/WEB-INF/lib/cewolf-1.0.jar:/opt/tomcat4/jakarta-tomcat-4.1.24/webapps/cadastro/example_cewolf/WEB-INF/lib/jcommon-1.0.0.jar:/opt/tomcat4/jakarta-tomcat-4.1.24/webapps/cadastro/example_cewolf/WEB-INF/lib/jfreechart-1.0.0.jar:/opt/tomcat4/jakarta-tomcat-4.1.24/webapps/cadastro/example_cewolf/WEB-INF/lib/log4j-1.2.12.jar:/opt/tomcat4/jakarta-tomcat-4.1.24/webapps/cadastro/example_cewolf/WEB-INF/lib/commons-logging-1.0.4.jar:/opt/tomcat4/jakarta-tomcat-4.1.24/webapps/cadastro/example_cewolf/WEB-INF/lib/gnujaxp-1.0.0.jar

      i did what u said but:

      machine:/opt/tomcat4/jakarta-tomcat-4.1.24/webapps/cadastro/example_cewolf/WEB-INF# javac -deprecation PageViewCountData.java

      PageViewCountData.java:33: package org.jfree.chart.tooltips does not exist
      import org.jfree.chart.tooltips.CategoryToolTipGenerator;
                                      ^
      PageViewCountData.java:41: cannot resolve symbol
      symbol  : class CategoryToolTipGenerator
      location: class de.laures.cewolf.examples.PageViewCountData
      public class PageViewCountData implements DatasetProducer, CategoryToolTipGenerator, CategoryItemLinkGenerator, Serializable {
                                                                 ^
      PageViewCountData.java:65: cannot resolve symbol
      symbol  : variable conn
      location: class de.laures.cewolf.examples.PageViewCountData
                 conn = null;
                 ^
      PageViewCountData.java:162: cannot resolve symbol
      symbol  : variable abreConexao
      location: class de.laures.cewolf.examples.PageViewCountData
              Connection conexao = abreConexao.getConnection();
                                   ^
      PageViewCountData.java:172: cannot resolve symbol
      symbol  : method addValue (java.lang.String,java.lang.String,java.lang.String)
      location: class org.jfree.data.category.DefaultCategoryDataset
                      dataset.addValue(rs.getString(3), seriesNames, rs.getString(2));
                             ^
      PageViewCountData.java:223: package de.laures.cewolf.example does not exist
                      log = LogFactory.getLog(de.laures.cewolf.example.PageViewCountData.class);
                                                                      ^
      6 errors

      What package i lost?
      Best Regards

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks