aspose file tools
The moose likes Beginning Java and the fly likes Not finding Packages when compiling (javamail) Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Not finding Packages when compiling (javamail)" Watch "Not finding Packages when compiling (javamail)" New topic
Author

Not finding Packages when compiling (javamail)

Jimmy Die
Ranch Hand

Joined: Nov 20, 2003
Posts: 97
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


Jimmy Die
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35438
    
    9
You can't use wildcards like "*.jar" in classpaths. Every jar file needs to be listed individually.


Android appsImageJ pluginsJava web charts
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24081
    
  15

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.


[Jess in Action][AskingGoodQuestions]
Jimmy Die
Ranch Hand

Joined: Nov 20, 2003
Posts: 97
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,
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Not finding Packages when compiling (javamail)
 
Similar Threads
Applet notinited
java onn windows vista
package apache.commons not exists
package javax.ejb does not exist with sun app server 8.0
Although activation.jar,mail.jar are in the same folder I get in compile(well?)