James
James

Reputation: 11

jvm-1.6 is not a valid choice for -target in eclipse

I imported an android App written in Scala to eclipse but I got this error when I tried to run it:

'jvm-1.6' is not a valid choice for '-target'

Does anyone know how to fix this?

Upvotes: 1

Views: 444

Answers (1)

Barney Govan
Barney Govan

Reputation: 664

I've also encountered this.

The best answer I've managed to come up with is that the android app is set up for scala 2.10 but your eclipse is using scala 2.9 or lower, as 'jvm-1.6' is only valid for scala 2.10 and above.

If you do have scala 2.10 installed and eclipse is using it, then you should be able to change it in the scala settings:

  1. Go to: Preferences -> Scala -> Compiler
  2. Change 'target' in the 'Standard' tab to 'jvm-1.6'

I haven't verified this as I don't have scala 2.10 installed yet -- I haven't found a .deb file for it yet -- but this answer on Google groups seems to suggest this is the cause.

Upvotes: 1

Related Questions