gpt4 book ai didi

java - 如何在 windows-64bit "Home Premium"中设置 javamail 路径和类路径

转载 作者:行者123 更新时间:2023-11-30 11:45:51 25 4
gpt4 key购买 nike

我已经在 Windows(64 位)上安装了 java。我的问题是:如何在我的 PC 上安装 Javamail?我用这种方式创建类路径 %classpath%;c:\.... 等。但仍然无法正常工作。我得到了错误

The import javax.mail cannot be resolved

最佳答案

要安装 Javamail,您应该查看 ReadMe .其中指出:

Note that the JavaMail API requires the JavaBeans(TM) Activation Framework package to be installed as well if you're using JDK 1.5 or earlier. Download the latest version of the JavaBeans Activation Framework from

http://www.oracle.com/technetwork/java/javase/index-jsp-136939.html

and install it in a suitable location.

  1. Unzip the javamail1_4_5.zip archive. (You may have already done this.)

  2. Set your CLASSPATH to include the "mail.jar" file obtained from the download, as well as the current directory.

    Assuming you unzipped javamail1_4_5.zip in c:\download the following would work:

    set CLASSPATH=%CLASSPATH%;c:\download\javamail-1.4.5\mail.jar;.

    Also, if you're using JDK 1.5 or earlier, include the "activation.jar" file that you obtained from downloading the JavaBeans Activation Framework, in your CLASSPATH.

    set CLASSPATH=%CLASSPATH%;c:\download\activation\activation.jar

  3. Go to the demo directory

  4. Compile any demo using your Java compiler. For example:

    javac msgshow.java

  5. Run the demo. The '-' option lists the required and optional command-line options to successfully run any demo. For example:

    java msgshow -

    lists the available options. And

    java msgshow -T imap -H -U -P -f INBOX 5

    uses the IMAP protocol to display message number 5 from your INBOX.

关于java - 如何在 windows-64bit "Home Premium"中设置 javamail 路径和类路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10161448/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com