Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

strange error message: bad symbolic reference. A signature in package.class refers to term apache in package org which is not available

Tags:

scala

akka

When I tried to compile simple typesafe' akka program (scala 2.10, akka, 2.1.0):

 scalac -cp "akka-actor_2.10-2.1.0.jar:akka-camel_2.10-2.1.0.jar" write2.scala

error: bad symbolic reference. A signature in package.class refers to term apache
in package org which is not available.
It may be completely missing from the current classpath, or the version on
the classpath might be incompatible with the version used when compiling package.class.
error: bad symbolic reference. A signature in package.class refers to term camel
in value org.apache which is not available.
It may be completely missing from the current classpath, or the version on
the classpath might be incompatible with the version used when compiling package.class.
write2.scala:21: error: bad symbolic reference. A signature in package.class refers to term model
in value org.camel which is not available.
It may be completely missing from the current classpath, or the version on
the classpath might be incompatible with the version used when compiling package.class.
val mina = system.actorOf(Props[MyEndPoint])

three errors found

The code on line 21:

 val mina = system.actorOf(Props[MyEndPoint])

(The same program was compiled correctly in Eclipse, so the source code is OK)

Most likely some jar file is missing in -cp variable. The question is what mean that strange/useless error message.

Thanks, Tomas

like image 736
xhudik Avatar asked Jan 15 '13 11:01

xhudik


2 Answers

The message says "There's no package org.apache in my classpath, and I need it while reading file package.class". Pass -Ylog-classpath to scalac and look at what is the real classpath that gets to the compiler.

like image 113
Iulian Dragos Avatar answered Nov 01 '22 14:11

Iulian Dragos


To me it was JDK not set on PATH neither JAVA_HOME

You can add JAVA_HOME to point to your JDK root folder and add jdk/bin folder (wich inludes javac) directly to the path.

You can refer to the Oracle docs for instruccions on how to add the path http://docs.oracle.com/javase/7/docs/webnotes/install/windows/jdk-installation-windows.html

like image 2
mancvso Avatar answered Nov 01 '22 14:11

mancvso