• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Not finding Packages when compiling (javamail)

 
Jimmy Die
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'm trying to compile my class extending james's mailet GenericMailet. I think that my environment variables are not correct or something, because I am getting

TestThis.java:9: cannot find symbol
symbol : class Mail
location: package org.apache.mailet
import org.apache.mailet.Mail;

Continously. Below I have my environment variable. I thought that I have everything I need for JAMES's packages to be found in their jar's. I did read the faq on environment variables, so I feel I have the right environment variables set.

Please help,
Thankyou



.;C:\PROGRA~1\Java\jdk1.6.0\lib;C:\PROGRA~1\Java\javamail-1.4;C:\PROGRA~1\Java\javamail-1.4\lib;C:\PROGRA~1\Java\jaf-1.1;C:\MyJava\james-2.3.0\lib;C:\PROGRA~1\Java;;C:\PROGRA~1\Java\jre1.6.0\lib\ext\QTJava.zip;C:\MyJava\james-2.3.0\lib;C:\PROGRA~1\Java\SAR-INF\lib;C:\PROGRA~1\Java\jdk1.6.0\lib;C:\PROGRA~1\Java\javamail-1.4\mail.jar;C:\PROGRA~1\Java\javamail-1.4\lib\*.jar;C:\PROGRA~1\Java\jaf-1.1\activation.jar;C:\PROGRA~1\Java\jaf-1.1\*.jar;C:\MyJava\james-2.3.0\lib\*.jar;C:\PROGRA~1\Java\james- 2.3.0.jar;C:\PROGRA~1\Java\*.jar;C:\PROGRA~1\Java\jre1.6.0\lib\ext\QTJava.zip;C:\MyJava\james-2.3.0\lib\*.jar;C:\PROGRA~1\Java\SAR-INF\lib\mailet-2.3.jar;C:\PROGRA~1\Java\SAR-INF\lib\*.jar
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't use wildcards like "*.jar" in classpaths. Every jar file needs to be listed individually.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Note that you can't use "*" in the CLASSPATH; you have to explicitly name jars. This might be messing things up for you; try removing the wildcards.

Better yet, don't use CLASSPATH at all. Provide just the jars your program needs using the -cp or -classpath switches to the compiler and runtime. Too much work? Then use a script, or learn to use Ant.
 
Jimmy Die
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I thought the * was valid, thanks for that heads up.

I'll also take your suggestion about the -classpath switch, and I am looking at ant also.

Thanks so much,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic