如何在Windows-64位“家庭高级版"中设置javamail路径和类路径. [英] How to set the javamail path and classpath in windows-64bit "Home Premium"

查看:109
本文介绍了如何在Windows-64位“家庭高级版"中设置javamail路径和类路径.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have installed java on Windows (64-bit). My question is: how do I install Javamail my PC? I used this way to create classpath %classpath%;c:\.... ect. but does not work still. I get the have error

导入javax.mail无法解析

The import javax.mail cannot be resolved

推荐答案

要安装Javamail,您应该查看

To install Javamail you should have a look at the ReadMe. Which states:

请注意,JavaMail API需要JavaBeans(TM)激活 如果您使用的是JDK 1.5或JDK,也要安装Framework软件包 较早.下载最新版本的JavaBeans激活 框架来自

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. 解压缩javamail1_4_5.zip归档文件. (您可能已经这样做了.)

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

将您的CLASSPATH设置为包括从以下位置获取的"mail.jar"文件 下载以及当前目录.

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

假设您在c:\ download中将javamail1_4_5.zip解压缩了 以下将起作用:

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

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

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

此外,如果您使用的是JDK 1.5或更早版本,请添加 您从下载的文件中获得的"activation.jar"文件 JavaBeans激活框架,在您的CLASSPATH中.

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

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

转到演示目录

使用Java编译器编译任何演示.例如:

Compile any demo using your Java compiler. For example:

javac msgshow.java

javac msgshow.java

运行演示. '-'选项列出了必需的和可选的 命令行选项以成功运行任何演示.例如:

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

java msgshow-

java msgshow -

列出可用的选项.还有

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

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

使用IMAP协议从您的收件箱中显示5号消息.

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

这篇关于如何在Windows-64位“家庭高级版"中设置javamail路径和类路径.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆