0

I have to do some assignments with Scala and I'm a newbie for this language. In the assignment, the prof requests me to implement serialization and deserialization, using twitter/chill. https://github.com/twitter/chill/

However, I don't know how to import the libary into my IDE Intellij.

Each time I use val instantiator = new ScalaKryoInstantiator. IDE notify me that: Cannot resolve symbol ScalaKryoInstantiator.

Could anyone can help me to resolve this issue?

Thanks and Best Regards,

Long.

Lup
  • 27
  • 5
  • 1
    You will need to add Chill as a dependency and then import the package. [Here](http://alvinalexander.com/scala/sbt-how-to-manage-project-dependencies-in-scala) is a good starting point and Or [here](https://confluence.jetbrains.com/display/IntelliJIDEA/Getting+Started+with+SBT) is something more directly related to IntelliJ. You will have to do a fair amount of reading about how Scala projects are structured. – evan.oman May 05 '17 at 22:05
  • Hi Evan058, thank you for your comment. i read the https://confluence.jetbrains.com/display/IntelliJIDEA/Getting+Started+with+SBT al ready. But I dont know which information of Chill to add it into the build.sbt file as a dependency :( https://github.com/twitter/chill/ – Lup May 05 '17 at 22:26

1 Answers1

1

One way to add a library in a Scala project, if you use sbt, is to add an sbt dependency. Most libraries and jars can be found and downloaded from the maven repositories: https://mvnrepository.com/artifact/com.twitter/chill_2.9.2/0.2.3

If you click the sbt tab on the page above, maven gives you a code snippet which can be directly pasted into your build.sbt. In order to compile and run your project using sbt, open the terminal in the directory where your build.sbt is located and use the "sbt run" command.

If you don't use sbt, download the jar from maven and follow the instructions in this answer: How to add external library in IntelliJ IDEA?

Community
  • 1
  • 1
  • It works now. After following your instruction, i can use the Twitter/chill without any error. Big thanks to you, Grant. – Lup May 06 '17 at 11:52