Using the JCE 1.2

Robert Yowell (yowell@spawar.navy.mil)
Mon, 28 Sep 1998 10:06:12 -0700

I encountered the following problem while using the JCE 1.2. When I
compiled a simple program,
import java.security.*;
import java.io.*;
import java.util.*;
import java.awt.*;
import javax.crypto.*;
import javax.crypto.spec.*;
import javax.crypto.interfaces.*;
import com.sun.crypto.provider.SunJCE.*;

public class TestCipher {
public static void main(String args[]) {

Cipher c = Cipher.getInstance("DES/ECB/PKCS5Padding");
}
}

I got the following error.

error: Invalid class file format:
/picantehome/cratch/jce/jce12-beta1-dom/lib/jce12-beta1-dom.jar(com/sun/crypto/provider/SunJCE.class),
wrong version: 46, expected 45
error: Invalid class file format:
/picantehome/cratch/jce/jce12-beta1-dom/lib/jce12-beta1-dom.jar(javax/crypto/Cipher.class),
wrong version: 46, expected 45
TestCipher.java:13: Class javax.crypto.Cipher not found in type
declaration.
Cipher c = Cipher.getInstance("DES/ECB/PKCS5Padding");
^
TestCipher.java:13: Class javax.crypto.Cipher not found in type
declaration.
Cipher c = Cipher.getInstance("DES/ECB/PKCS5Padding");
^
TestCipher.java:13: Undefined variable or class name: Cipher
Cipher c = Cipher.getInstance("DES/ECB/PKCS5Padding");
^
5 errors

Is this problem due to an incorrect version of JDK1.2? I have not seen
this type of error in the past.

Bob Yowell