- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Twitter Eval with sbt doesn't work on 32bit java
Thu, 2011-12-29, 19:57
I am trying to use twitter eval, running it through sbt commandline.
It works on 64-bit Windows 7 with java version:
java version "1.7.0_02"
Java(TM) SE Runtime Environment (build 1.7.0_02-b13)
Java HotSpot(TM) 64-Bit Server VM (build 22.0-b10, mixed mode)
But it doesn't work on 32-bit Windows XP
main.scala:
java version "1.7.0_02"
Java(TM) SE Runtime Environment (build 1.7.0_02-b13)
Java HotSpot(TM) Client VM (build 22.0-b10, mixed mode, sharing)
It raises the following exception:
[info] Running Main
[error] (run-main) scala.tools.nsc.MissingRequirementError: object
scala not found.
scala.tools.nsc.MissingRequirementError: object scala not found.
at scala.tools.nsc.symtab.Definitions$definitions
$.getModuleOrClass(Definitions.scala:655)
at scala.tools.nsc.symtab.Definitions$definitions
$.getModule(Definitions.scala:605)
at scala.tools.nsc.symtab.Definitions$definitions
$.ScalaPackage(Definitions.scala:145)
at scala.tools.nsc.symtab.Definitions$definitions
$.ScalaPackageClass(Definitions.scala:146)
at scala.tools.nsc.symtab.Definitions$definitions
$.AnyClass(Definitions.scala:176)
at scala.tools.nsc.symtab.Definitions$definitions
$.init(Definitions.scala:814)
at scala.tools.nsc.Global$Run.(Global.scala:697)
at com.twitter.util.Eval$StringCompiler.apply(Eval.scala:523)
at com.twitter.util.Eval$StringCompiler$$anonfun$apply
$3.apply(Eval.scala:540)
at com.twitter.util.Eval$StringCompiler$$anonfun$apply
$3.apply(Eval.scala:539)
at scala.Option.getOrElse(Option.scala:108)
at com.twitter.util.Eval$StringCompiler.apply(Eval.scala:539)
at com.twitter.util.Eval.applyProcessed(Eval.scala:198)
at com.twitter.util.Eval.applyProcessed(Eval.scala:191)
at com.twitter.util.Eval.apply(Eval.scala:137)
at Main$.main(Main.scala:11)
at Main.main(Main.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
at java.lang.reflect.Method.invoke(Unknown Source)
java.lang.RuntimeException: Nonzero exit code: 1
at scala.sys.package$.error(package.scala:27)
[error] {file:/C:/ahmet/scala/evaltest/}default-74d3a5/compile:run:
Nonzero exit code: 1
[error] Total time: 3 s, completed Dec 29, 2011 1:51:46 PM
-----------------------------------
FILES:
object Main {
def main(args:Array[String])
{
val value = (new com.twitter.util.Eval).apply[Int]("1+1")
println("value is " + value)
}
}
----------------------------------
build.sbt
name := "mm"
version := "1.0"
scalaVersion := "2.9.1"
resolvers += "twitter-repo" at "http://maven.twttr.com"
scalacOptions ++= Seq("-deprecation")
libraryDependencies ++= Seq(
"com.twitter" % "util-core_2.9.1" % "1.12.8", "com.twitter" % "util-
eval_2.9.1" % "1.12.8"
)
------------------------------------------
This is a dumbed down version for reproducing the error. However in my
actual program it gives this too:
[error] (run-main) java.lang.Error: typeConstructor inapplicable for
java.lang.Error: typeConstructor inapplicable for
at scala.tools.nsc.symtab.SymbolTable.abort(SymbolTable.scala:
34)
at scala.tools.nsc.symtab.Symbols
$Symbol.typeConstructor(Symbols.scala:877)
at scala.tools.nsc.symtab.Definitions$definitions$.scala$tools
$nsc$symtab$Definitions$definitions$$booltype(Def
nitions.scala:157)
at scala.tools.nsc.symtab.Definitions$definitions
$.init(Definitions.scala:814)
at scala.tools.nsc.Global$Run.(Global.scala:697)
at com.twitter.util.Eval$StringCompiler.apply(Eval.scala:523)
at com.twitter.util.Eval$StringCompiler$$anonfun$apply
$3.apply(Eval.scala:540)
at com.twitter.util.Eval$StringCompiler$$anonfun$apply
$3.apply(Eval.scala:539)
at scala.Option.getOrElse(Option.scala:108)
at com.twitter.util.Eval$StringCompiler.apply(Eval.scala:539)
at com.twitter.util.Eval.applyProcessed(Eval.scala:198)
at com.twitter.util.Eval.applyProcessed(Eval.scala:191)
at com.twitter.util.Eval.apply(Eval.scala:137)
at com.twitter.util.Eval.apply(Eval.scala:171)
at mm.Main$.(Main.scala:18)
at mm.Main$.(Main.scala)
at mm.Main.main(Main.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
at java.lang.reflect.Method.invoke(Unknown Source)
java.lang.RuntimeException: Nonzero exit code: 1
at scala.sys.package$.error(package.scala:27)
--------------------------------
Any help is appreciated. Thanks.
Tue, 2012-01-03, 17:51
#2
Re: Twitter Eval with sbt doesn't work on 32bit java
I found out the problem: It is windows. Here is the workaround.
http://groups.google.com/group/simple-build-tool/browse_thread/thread/ef...
It works on the same machine (that it doesn't work using sbt) if I run
it through REPL
C:\xxxx\scala\evaltest\src\main\scala>scala -classpath "c:\Documents
and Settings\xx\.ivy2\cache\com.twitter\util-eval_2.9.1\jars\util-
eval_2.9.1-1.12.8.jar"
Welcome to Scala version 2.9.1.final (Java HotSpot(TM) Client VM, Java
1.7.0_02).
Type in expressions to have them evaluated.
Type :help for more information.
scala> val value = (new com.twitter.util.Eval).apply[Int]("1+1")
value: Int = 2
scala>
On Dec 29, 1:57 pm, Ahmet Sevki wrote:
> I am trying to use twitter eval, running it through sbt commandline.
> It works on 64-bit Windows 7 with java version:
> java version "1.7.0_02"
> Java(TM) SE Runtime Environment (build 1.7.0_02-b13)
> Java HotSpot(TM) 64-Bit Server VM (build 22.0-b10, mixed mode)
>
> But it doesn't work on 32-bit Windows XP
> main.scala:
> java version "1.7.0_02"
> Java(TM) SE Runtime Environment (build 1.7.0_02-b13)
> Java HotSpot(TM) Client VM (build 22.0-b10, mixed mode, sharing)
>
> It raises the following exception:
> [info] Running Main
> [error] (run-main) scala.tools.nsc.MissingRequirementError: object
> scala not found.
> scala.tools.nsc.MissingRequirementError: object scala not found.
> at scala.tools.nsc.symtab.Definitions$definitions
> $.getModuleOrClass(Definitions.scala:655)
> at scala.tools.nsc.symtab.Definitions$definitions
> $.getModule(Definitions.scala:605)
> at scala.tools.nsc.symtab.Definitions$definitions
> $.ScalaPackage(Definitions.scala:145)
> at scala.tools.nsc.symtab.Definitions$definitions
> $.ScalaPackageClass(Definitions.scala:146)
> at scala.tools.nsc.symtab.Definitions$definitions
> $.AnyClass(Definitions.scala:176)
> at scala.tools.nsc.symtab.Definitions$definitions
> $.init(Definitions.scala:814)
> at scala.tools.nsc.Global$Run.(Global.scala:697)
> at com.twitter.util.Eval$StringCompiler.apply(Eval.scala:523)
> at com.twitter.util.Eval$StringCompiler$$anonfun$apply
> $3.apply(Eval.scala:540)
> at com.twitter.util.Eval$StringCompiler$$anonfun$apply
> $3.apply(Eval.scala:539)
> at scala.Option.getOrElse(Option.scala:108)
> at com.twitter.util.Eval$StringCompiler.apply(Eval.scala:539)
> at com.twitter.util.Eval.applyProcessed(Eval.scala:198)
> at com.twitter.util.Eval.applyProcessed(Eval.scala:191)
> at com.twitter.util.Eval.apply(Eval.scala:137)
> at Main$.main(Main.scala:11)
> at Main.main(Main.scala)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
> Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> java.lang.RuntimeException: Nonzero exit code: 1
> at scala.sys.package$.error(package.scala:27)
> [error] {file:/C:/ahmet/scala/evaltest/}default-74d3a5/compile:run:
> Nonzero exit code: 1
> [error] Total time: 3 s, completed Dec 29, 2011 1:51:46 PM
> -----------------------------------
> FILES:
> object Main {
>
> def main(args:Array[String])
> {
> val value = (new com.twitter.util.Eval).apply[Int]("1+1")
> println("value is " + value)
> }}
>
> ----------------------------------
> build.sbt
>
> name := "mm"
>
> version := "1.0"
>
> scalaVersion := "2.9.1"
>
> resolvers += "twitter-repo" at "http://maven.twttr.com"
>
> scalacOptions ++= Seq("-deprecation")
>
> libraryDependencies ++= Seq(
> "com.twitter" % "util-core_2.9.1" % "1.12.8", "com.twitter" % "util-
> eval_2.9.1" % "1.12.8"
> )
>
> ------------------------------------------
> This is a dumbed down version for reproducing the error. However in my
> actual program it gives this too:
>
> [error] (run-main) java.lang.Error: typeConstructor inapplicable for
>
> java.lang.Error: typeConstructor inapplicable for
> at scala.tools.nsc.symtab.SymbolTable.abort(SymbolTable.scala:
> 34)
> at scala.tools.nsc.symtab.Symbols
> $Symbol.typeConstructor(Symbols.scala:877)
> at scala.tools.nsc.symtab.Definitions$definitions$.scala$tools
> $nsc$symtab$Definitions$definitions$$booltype(Def
> nitions.scala:157)
> at scala.tools.nsc.symtab.Definitions$definitions
> $.init(Definitions.scala:814)
> at scala.tools.nsc.Global$Run.(Global.scala:697)
> at com.twitter.util.Eval$StringCompiler.apply(Eval.scala:523)
> at com.twitter.util.Eval$StringCompiler$$anonfun$apply
> $3.apply(Eval.scala:540)
> at com.twitter.util.Eval$StringCompiler$$anonfun$apply
> $3.apply(Eval.scala:539)
> at scala.Option.getOrElse(Option.scala:108)
> at com.twitter.util.Eval$StringCompiler.apply(Eval.scala:539)
> at com.twitter.util.Eval.applyProcessed(Eval.scala:198)
> at com.twitter.util.Eval.applyProcessed(Eval.scala:191)
> at com.twitter.util.Eval.apply(Eval.scala:137)
> at com.twitter.util.Eval.apply(Eval.scala:171)
> at mm.Main$.(Main.scala:18)
> at mm.Main$.(Main.scala)
> at mm.Main.main(Main.scala)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
> Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> java.lang.RuntimeException: Nonzero exit code: 1
> at scala.sys.package$.error(package.scala:27)
> --------------------------------
> Any help is appreciated. Thanks.