Please note that the directory tree should also exist in the source. i.e. if your StringEncrypter.class is in folder "sf/io/" then the source should have been under sf/io/ to begin with. The compiler will automatically create the "sf/io/" directories when compiling and put the .class there
Main Topics
Browse All Topics





by: ozlevanonPosted on 2009-08-10 at 08:37:51ID: 25060923
In the code above the file is written with package "examples" (first line). Is this the case in your runtime? If so, the package of the class must match the directory tree it is in.
gException ; ception; thmExcepti on; ;
Exception; ory; ec; ySpec;
For example, if your class is located in in directory sf/io/ in the jar, its package must be "sf.io" like so:
package sf.io;
import java.io.UnsupportedEncodin
import java.security.InvalidKeyEx
import java.security.NoSuchAlgori
import java.security.spec.KeySpec
import javax.crypto.Cipher;
import javax.crypto.NoSuchPadding
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFact
import javax.crypto.spec.DESKeySp
import javax.crypto.spec.DESedeKe
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
public class StringEncrypter
...