Discussion:
[問題] 掛JCE時的安裝問題也有關CLASSPATE
(时间太久无法回复)
開團北海道千層蛋糕
2007-05-08 12:05:52 UTC
Permalink
因為需要加解碼而下載了JCE的套件 因為是新手有些安裝方法不大懂

去找了類似的中文安裝方法是:

簡易安裝把 jce1.2.1\lib 下的所有內容複製到 %java_home%\lib\ext下,如果沒有ext目
錄自行建立,再把jce1_2_1.jar和sunjce_provider.jar新增到CLASSPATH內
^^^^^^^^^^^^^^^

然後英文的安裝方法:

The JCE 1.2.2 framework and the "SunJCE" provider are supplied as extensions
(also known as "optional packages") to the Java 2 platform.
The lib subdirectory extracted in the previous step contains the jce1_2_2.jar
and sunjce_provider.jar files. The lib subdirectory should also contain JAR
files for jurisdiction policy files: US_export_policy.jar and
local_policy.jar.

Two types of installations are supported, described below. In both cases, the
jurisdiction policy files must be installed in the same directory as that
which contains the JCE 1.2.2 framework JAR file. In some cases, permissions
must be granted to the JCE 1.2.2 framework and/or the "SunJCE" provider for
when applets or applications using JCE are run while a security manager is
installed. Note: There is typically a security manager installed whenever an
applet is running, and a security manager may be installed for an application
either via code in the application itself or via a command-line argument.

Instructions: To make the JCE 1.2.2 framework an installed extension, move or
copy the jce1_2_2.jar, US_export_policy.jar, and local_policy.jar files from
the lib subdirectory extracted in the previous step to the standard place for
the JAR files of an installed extension:

<java-home>\lib\ext [Win32]
<java-home>/lib/ext [Solaris]
Here <java-home> refers to the directory where the runtime software is
installed, which is the top-level directory of the JRE or the jre directory
in the JavaTM 2 SDK software. For example, if you have J2SDK v 1.2.2
installed on Solaris in a directory named jdk1.2.2, you need to install the
JAR files in the following directory:
jdk1.2.2/jre/lib/ext
Similarly, if you have JavaTM 2 Runtime Environment v 1.2.2 installed on
Solaris in a directory named jre1.2.2, you need to install the JAR files in
the following directory:
jre1.2.2/lib/ext
To also make the "SunJCE" provider an "installed" extension, move or copy
sunjce_provider.jar to that same directory for installed extensions. If you
want to make the "SunJCE" provider a "bundled" extension

然後我執行我的JAVA檔案會出現:

SecretWriting.java:4: package java.crypto does not exist
import java.crypto.*;
^

謝謝大家看了這麼長的文章請大家幫忙要怎麼設定和操作 感激不盡^^b

--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.229.111.153
愚人
2007-05-08 12:35:46 UTC
Permalink
你用什麼版本的 jdk

jce 似乎很早就內建了

* JCE in J2SE (included as part of J2SE 1.4.x and later)
* JCE 1.2.2 is an optional package to the Java 2 SDK,
versions 1.2.x and 1.3.x.

還是你不用用 sun jdk

※ 引述《deepblue0106 (開團北海道千層蛋糕)》之銘言:
: 因為需要加解碼而下載了JCE的套件 因為是新手有些安裝方法不大懂
: 去找了類似的中文安裝方法是:
: 簡易安裝把 jce1.2.1\lib 下的所有內容複製到 %java_home%\lib\ext下,如果沒有ext目
: 錄自行建立,再把jce1_2_1.jar和sunjce_provider.jar新增到CLASSPATH內

--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 125.232.233.95
godfat 真常
2007-05-08 12:59:49 UTC
Permalink
※ 引述《deepblue0106 (開團北海道千層蛋糕)》之銘言:
: 然後我執行我的JAVA檔案會出現:
: SecretWriting.java:4: package java.crypto does not exist
: import java.crypto.*;
: ^

import javax.crypto.*;

--
Nobody can take anything away from him.
Nor can anyone give anything to him.

What came from the sea,
has returned to the sea.
Chrono Cross

--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.134.30.220

继续阅读narkive:
Loading...