Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@apache.org Received: (qmail 41050 invoked from network); 24 Jan 2003 19:01:31 -0000 Received: from exchange.sun.com (192.18.33.10) by 208.185.179.12.available.above.net with SMTP; 24 Jan 2003 19:01:31 -0000 Received: (qmail 9002 invoked by uid 97); 24 Jan 2003 19:02:28 -0000 Delivered-To: qmlist-jakarta-archive-ant-user@jakarta.apache.org Received: (qmail 8838 invoked by uid 97); 24 Jan 2003 19:02:25 -0000 Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 8707 invoked by uid 98); 24 Jan 2003 19:02:23 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Message-ID: From: David McTavish To: 'Ant Users List' Subject: RE: javax and ant Date: Fri, 24 Jan 2003 14:00:48 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: 208.185.179.12.available.above.net 1.6.2 0/1000/N X-Spam-Rating: 208.185.179.12.available.above.net 1.6.2 0/1000/N try creating a classpath element in your build file and include the jar file that way for starters. I find we get more problems when compiling and using the classpath that Ant inherits than its worth. (ie: we were having a ton of problems with inconsistencies with the XML library that Ant was using and a newer version that we were trying to compile with. Code wouldn't compile because the class-loader was finding the wrong library). d. -----Original Message----- From: Irazabal, Alex [mailto:Alex.Irazabal@aig.com] Sent: Friday, January 24, 2003 1:57 PM To: 'ant-user@jakarta.apache.org' Subject: javax and ant Hi. I have a program that compiles standalone but when I use the build file refuses to import javax.servlet. Any ideas will be GREATLY appriciated. The problems seems to be that the build is IGNORING my classpath (as seen in the debug output of the build). My classpath is not included in the debug output. I have tried to set build.sysclasspath=only and/or ignore. I have spent way too much time on what should be a no-brainer... Source code: /* * stockscrape.java * * Created on January 23, 2003, 2:39 PM */ /** * * @author airazaba */ package stock; import java.io.*; import java.net.*; import javax.servlet.*; public class stockscrape { /** Creates a new instance of stockscrape */ public stockscrape() { } /** * @param args the command line arguments */ public static void main(String [] args) throws Exception { if (args.length!=1){ System.out.println("Usage: java Stock "); System.exit(0); } String yahoo = "finance.yahoo.com"; final int httpd= 80; Socket sock = new Socket(yahoo, httpd); BufferedWriter out = new BufferedWriter(new OutputStreamWriter(sock.getOutputStream())); String cmd = "GET /q?" + "s=" + args[0] + "\n"; out.write(cmd); out.flush(); BufferedReader in = new BufferedReader( new InputStreamReader(sock.getInputStream())); String s = null; int i,j; while ( ( s=in.readLine()) != null) { if (s.length() <25) continue; if ((i = s.indexOf(args[0].toUpperCase())) < 0) continue; s = s.substring(i); if ((i = s.indexOf("")) < 0) continue; j = s.indexOf(""); s = s.substring(i+3,j); System.out.println(args[0] + " is at "+s); break; } } } build file: errors from build "all": parsing buildfile C:\jakarta\examples\stock\build.xml with URI = file:C:/jakarta/examples/stock/build.xml Setting ro project property: ant.project.name -> stock Adding reference: stock -> org.apache.tools.ant.Project@16729a9 Project base dir set to: C:\jakarta\examples\stock +Target: compile +Task: javac +Target: jar +Task: jar +Target: all +Task: echo +Target: stockscrape +Task: java +Target: javadoc +Task: mkdir +Task: javadoc +Target: clean +Task: delete +Task: delete +Task: delete Build sequence for target `all' is [compile, jar, all] Complete build sequence is [compile, jar, all, stockscrape, javadoc, clean] compile: fileset: Setup scanner in dir C:\jakarta\examples\stock with patternSet{ includes: [] excludes: [] } .nbattrs skipped - don't know how to handle it build.xml skipped - don't know how to handle it stock.jar skipped - don't know how to handle it stocksample.jar skipped - don't know how to handle it stockscrape.class skipped - don't know how to handle it stockscrape.java added as C:\jakarta\examples\stock\stockscrape.class is outdated. stockscrape.mf skipped - don't know how to handle it Compiling 1 source file to C:\jakarta\examples\stock Using modern compiler Compilation arguments: '-deprecation' '-d' 'C:\jakarta\examples\stock' '-classpath' 'C:\jakarta\examples\stock;C:\Program Files\NetBeans IDE 3.4\lib\patches\openide-compat.jar;C:\Program Files\NetBeans IDE 3.4\lib\core-compiler.jar;C:\Program Files\NetBeans IDE 3.4\lib\core-execution.jar;C:\Program Files\NetBeans IDE 3.4\lib\core-ide.jar;C:\Program Files\NetBeans IDE 3.4\lib\core-ui.jar;C:\Program Files\NetBeans IDE 3.4\lib\core-windows.jar;C:\Program Files\NetBeans IDE 3.4\lib\core.jar;C:\Program Files\NetBeans IDE 3.4\lib\openide.jar;C:\Program Files\NetBeans IDE 3.4\lib\ext\locale\ddl_ja.jar;C:\Program Files\NetBeans IDE 3.4\lib\ext\crimson.jar;C:\Program Files\NetBeans IDE 3.4\lib\ext\ddl.jar;C:\Program Files\NetBeans IDE 3.4\lib\ext\idlcompilers.jar;C:\Program Files\NetBeans IDE 3.4\lib\ext\logger.jar;C:\Program Files\NetBeans IDE 3.4\lib\ext\openorb-1.0.2.jar;C:\Program Files\NetBeans IDE 3.4\lib\ext\regexp.jar;C:\Program Files\NetBeans IDE 3.4\lib\ext\rmi-ext.jar;C:\Program Files\NetBeans IDE 3.4\lib\ext\terminalemulator.jar;C:\Program Files\NetBeans IDE 3.4\lib\ext\xerces.jar;C:\Program Files\NetBeans IDE 3.4\lib\ext\xml-apis.jar;C:\j2sdk1.4.1\lib\dt.jar;C:\j2sdk1.4.1\lib\tools.ja r' '-sourcepath' 'C:\jakarta\examples\stock' '-g' The ' characters around the executable and arguments are not part of the command. File to be compiled: C:\jakarta\examples\stock\stockscrape.java stock/stockscrape.java [15] package javax.servlet does not exist import javax.servlet.*; ^ 1 error file:C:/jakarta/examples/stock/build.xml:17: Compile failed; see the compiler error output for details. at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:842) at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:682) at org.apache.tools.ant.Task.perform(Task.java:319) at org.apache.tools.ant.Target.execute(Target.java:309) at org.apache.tools.ant.Target.performTasks(Target.java:336) at org.apache.tools.ant.Project.executeTarget(Project.java:1306) at org.apache.tools.ant.Project.executeTargets(Project.java:1250) at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:294) at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:119) BUILD FAILED Total time: 0 seconds -- To unsubscribe, e-mail: For additional commands, e-mail: -- To unsubscribe, e-mail: For additional commands, e-mail: