2012-12-31

Java package javax.crypto does not exist error

Do you get this upon build?

COMPILATION ERROR :
-------------------------------------------------------------
com/rapidlime/pohlidame/utils/StringEncrypter.java:[3,19] package javax.crypto does not exist
com/rapidlime/pohlidame/utils/StringEncrypter.java:[4,24] package javax.crypto.spec does not exist
com/rapidlime/pohlidame/utils/StringEncrypter.java:[5,24] package javax.crypto.spec does not exist
com/rapidlime/pohlidame/utils/StringEncrypter.java:[19,6] cannot find symbol
symbol  : class Cipher

You likely use Java 1.5.0. If you use Maven, you may have this in your pom.xml:

<!-- Compiler plugin -->
<plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
        <verbose>false</verbose>
        <compilerVersion>1.5</compilerVersion>
        <source>1.5</source>
        <target>1.5</target>
        <encoding>utf-8</encoding>
    </configuration>
</plugin>

You need to set this:

<!-- Compiler plugin -->
<plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
        <verbose>false</verbose>
        <compilerVersion>1.6</compilerVersion>
        <source>1.6</source>
        <target>1.6</target>
        <encoding>utf-8</encoding>
    </configuration>
</plugin>

HTH.


0