Setting ant -source parameter for Android Coding Academy

Code junkies hangout here

Moderators: ChriThor, LXF moderators

Setting ant -source parameter for Android Coding Academy

Postby Mad-Halfling » Sun Jan 27, 2013 5:12 pm

Having a bit of a brain-failure. I'm poking my way around the Android coding academy sections and in part 2 I'm getting a compiler error when I run
Code: Select all
ant debug

Code: Select all
    [javac] /home/(user)/Coding/countdown/src/com/example/countdown/ error: strings in switch are not supported in -source 1.5
    [javac]         switch(item.getItemId()) {
    [javac]                              ^
    [javac]   (use -source 7 or higher to enable strings in switch)

but I can't find where to set this parameter. I've got openjdk-7 installed and JAVA_HOME points to
Code: Select all
/usr/lib/jvm/default-java -> java-1.7.0-openjdk-amd64

So where do I set this (I'm sure it's something simple, but ant doesn't accept the -source parameter and Google hasn't brought up the config details)?

Note that this compiler error is the result of a typo, but I was wondering how to do this for future reference, or in case I want to use this in future.

Cheers - MH
Posts: 6
Joined: Sun Jun 22, 2008 1:05 am

Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests