kula
kula

Reputation: 345

simple scala question about httpparser

i'm a scala newbee. i have one question. in my code ,i try to import httpparse library like this

 scalac -classpath /home/kula/code/201005/kookle/lib/htmlparser.jar     crawler.scala

and i run this code.

scala main

and it tell me that

      java.lang.NoClassDefFoundError: org/htmlparser/Parser

at FetchActor$$anonfun$act$1$$anonfun$apply$1.apply(crawler.scala:21) at FetchActor$$anonfun$act$1$$anonfun$apply$1.apply(crawler.scala:13) at scala.actors.Reaction.run(Reaction.scala:78) at scala.actors.FJTask$Wrap.run(Unknown Source) at scala.actors.FJTaskRunner.scanWhileIdling(Unknown Source) at scala.actors.FJTaskRunner.run(Unknown Source)

i check the file./home/kula/code/201005/kookle/lib/htmlparser.jar and it is no problem.anyone can tell me how cause this bug?

Upvotes: 0

Views: 304

Answers (2)

Jackson Davis
Jackson Davis

Reputation: 3401

Arjan's answer should work. However, I would recommend just using sbt and let it figure out all of this stuff for you.

Upvotes: 0

Arjan Blokzijl
Arjan Blokzijl

Reputation: 6888

try


scala -classpath /home/kula/code/201005/kookle/lib/htmlparser.jar crawler.scala

i.e. also run it with the required jars on the classpath

Upvotes: 4

Related Questions