Re: [scala-ide-user] "too many arguments for method copyMemory: " in

91 views
Skip to first unread message

Simon Schäfer

unread,
May 14, 2013, 6:09:16 AM5/14/13
to scala-i...@googlegroups.com
This doesn't seem to be a problem of Scala IDE. After quick googling it came out that the method doesn't exist in OpenJDK6: http://mail.openjdk.java.net/pipermail/jdk6-dev/2013-January/002836.html


On 05/14/2013 03:31 AM, Cheng Hao wrote:
Hi, 
   I tried the following scala code with eclipse 

"Scala IDE build of Eclipse SDK
Build id: 3.0.0-vfinal-20130326-1453-Typesafe" under Ubuntu LTS 12.03

object T extends App {
  val unsafe: sun.misc.Unsafe = {
      val unsafeField = classOf[sun.misc.Unsafe].getDeclaredField("theUnsafe")
      unsafeField.setAccessible(true)
      unsafeField.get(null).asInstanceOf[sun.misc.Unsafe]
  }
  def t()  {
    //too many arguments for method copyMemory: (x$1: Long, x$2: Long, x$3: Long)Unit
    unsafe.copyMemory(null, 1, null, 1, 100)  // cannot be compiled of this line within the Scala IDE
  } 
  println (System.getProperty("java.version")) // 1.6.0_45
  println (System.getProperty("java.vm.version")) // 20.45-b01
  println (scala.util.Properties.scalaPropOrElse("version.number", "unknown")) // 2.9.3
}

The IDE complaints about "too many arguments for method copyMemory: (x$1: Long, x$2: Long, x$3: Long)Unit" for the line "unsafe.copyMemory(null, 1, null, 1, 100)"; but I am pretty sure the sun.misc.Unsafe has the method signature "copyMemory(Object,long,Object,long,long):void"

And I also tried that in Scala Interpreter and Scala IDE on windows 7, everything works fine.
And I also tried that with the ScalaIDE(for scala 2.10), everything works fine too.

Seems it's a quite specific Scala IDE issue for Scala 2.9.3 under Ubuntu to me.

Appreciate it if any comment or workaround solution for that, I have to coding under Ubuntu with scala 2.9.3.

Thanks,
Hao
--
You received this message because you are subscribed to the Google Groups "Scala IDE User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-ide-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Luc Bourlier

unread,
May 14, 2013, 6:36:17 AM5/14/13
to scala-i...@googlegroups.com
It might be linked to this ticket: https://www.assembla.com/spaces/scala-ide/simple_planner#/ticket:1001387

It is possible that with Scala 2.9.x, the builder doesn't use the specified JDK. It would have to be checked.

Luc

Cheng Hao

unread,
May 14, 2013, 9:49:42 PM5/14/13
to scala-i...@googlegroups.com
"changing buildmanager from sbt to refined in
Preferences->Scala->Compiler-"Build Manager"
fixes this issue"

This works.

Thank you.
Hao

在 2013年5月14日星期二UTC+8下午6时36分17秒,Luc Bourlier写道:
Reply all
Reply to author
Forward
0 new messages