The Artima Developer Community
Sponsored Link

ScalaTest/ScalaUtils Forum
VerifyError - main method can only throw Throwable.

2 replies on 1 page. Most recent reply: Apr 10, 2009 6:46 PM by Jeremy Mawson

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
Jeremy Mawson

Posts: 3
Nickname: synesso
Registered: Apr, 2009

VerifyError - main method can only throw Throwable. Posted: Apr 10, 2009 6:40 PM
Reply to this message Reply
Advertisement
Hi. I cannot execute the scalatest ant task. It throws the following exception:

java.lang.VerifyError: (class: org/scalatest/tools/Runner$, method: main signature: ([Ljava/lang/String;)V) Can only throw Throwable objects
at org.scalatest.tools.Runner.main(Runner.scala)
at org.scalatest.tools.ScalaTestTask.execute(ScalaTestTask.java:197)
...

I have the following versions:

java -version
java version "1.5.0_18"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_18-b02)
Java HotSpot(TM) Client VM (build 1.5.0_18-b02, mixed mode, sharing)

scala -version
Scala code runner version 2.7.3.final -- Copyright 2002-2009, LAMP/EPFL

scalatest
982957 2009-03-04 12:13 scalatest-0.9.5.jar

build.xml extract

<path id="scalatest.classpath">
<path location="test/lib/scalatest-0.9.5.jar" />
<path location="src/lib/scala-library.jar" />
</path>
<taskdef name="scalatest" classname="org.scalatest.tools.ScalaTestTask">
<classpath refid="scalatest.classpath"/>
</taskdef>
<target name="tested-classes" ... >
<scalatest>
<suite classname="au.com.loftinspace.scalachess.game.SquareSpec" />
</scalatest>
</target>


Can anyone offer me a clue on this?

Thanks
Jeremy


Jeremy Mawson

Posts: 3
Nickname: synesso
Registered: Apr, 2009

Re: VerifyError - main method can only throw Throwable. Posted: Apr 10, 2009 6:42 PM
Reply to this message Reply
The same error occurs with:

java -version
java version "1.6.0_13"
Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
Java HotSpot(TM) Client VM (build 11.3-b02, mixed mode, sharing)

Jeremy Mawson

Posts: 3
Nickname: synesso
Registered: Apr, 2009

Re: VerifyError - main method can only throw Throwable. Posted: Apr 10, 2009 6:46 PM
Reply to this message Reply
I just solved my own problem by chance.

The scala-library.jar which is in the src libs did not correspond to the scala version that was installed. I copied scala.home/lib/scala-library.jar to my src libs and all is well.

Flat View: This topic has 2 replies on 1 page
Topic: unable to compile the StackSpec example Previous Topic   Next Topic Topic: Problem with 0.9.5

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use