user842225
user842225

Reputation: 6009

dependency (for sun.security.util) of SBT build

I am using SBT to build my Scala project. I have also Java code in my project.

When I run the build I constantly get following error:

error: package sun.security.util does not exist [error] import sun.security.util.ObjectIdentifier;

I understand that I need to declare dependency to the sun.security.util, but I don't know what is the dependency I should depend on?

My build.sbt contains:

libraryDependencies ++= Seq("org.springframework" % "spring-dao" % 2.0.8",)

My JDK version is "1.7.0_25". I need to use the sun.security.util package. This link said it is not guaranteed in JDK. How can I declare the dependency to make it work? I mean, What is the name of dependency I should add?

Upvotes: 10

Views: 3720

Answers (2)

AlexBrand
AlexBrand

Reputation: 12429

Packages in sun.* are not guaranteed to work everywhere. Thus, it is not recommended to use these packages, unless the JVM running your code is under your control.

Check out http://www.oracle.com/technetwork/java/faq-sun-packages-142232.html for more information.

Upvotes: 5

xring
xring

Reputation: 767

The package sun.security.util is from JDK, so you don't need to add dependency in your build.sbt file.

Check your environment.

Here is my environment, it works well.


javac -version
javac 1.7.0_71


java -version
java version "1.7.0_71" Java(TM) SE Runtime Environment (build 1.7.0_71-b14) Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)


scalac -version
Scala compiler version 2.10.4 -- Copyright 2002-2013, LAMP/EPFL


scala -version
Scala code runner version 2.10.4 -- Copyright 2002-2013, LAMP/EPFL

Upvotes: 0

Related Questions