Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Syntax error, annotations are only available if source level is 5.0
Syntax error, annotations are only available if source level is 5.0 [message #167181] Thu, 24 August 2006 21:01 Go to next message
Eclipse UserFriend
Originally posted by: d-innis.ti.com

Hi,

I'm new to eclipse so please forgive me if I've emailed the wrong group.
I'm trying to build eclipse 3.2/cdt 3.1 on windows 2000 from the command
line. I have both java 1.4 and 1.5 installed, I'm building with java 1.4
as the default. I keep getting the errors below when compiling the jdt
plugins:

1. ERROR in
E:\buildforge\CCE3.1\plugins\org.eclipse.jdt.junit4.runtime\ src\org\eclipse\jdt\internal\junit4\runner\JUnit4Identifier. java
[java] [javac] (at line 29)
[java] [javac] @Override
[java] [javac] ^^^^^^^^^
[java] [javac] Syntax error, annotations are only available if
source level is 5.0

I googled the issue, saw there was one bug filed in Feb., tried to follow
their solution (was for linux) but it doesn't work.

I have tried adding the javacSource property set to 1.5 in my build.xml
I have tried passing in -Djava5home to eclipse.antrunner.
I have tried changing the java version to 1.5.

Nothing seems to change the error message. I know I'm missing something,
or there'd be a lot more out there regarding this issue, but I'm really
stumped.

If anyone can point me in the right direction, I'd be eternally grateful!
thanks,
Danish
Re: Syntax error, annotations are only available if source level is 5.0 [message #167293 is a reply to message #167181] Fri, 25 August 2006 08:05 Go to previous messageGo to next message
kiril mitov is currently offline kiril mitovFriend
Messages: 128
Registered: July 2009
Senior Member
Hi Danish,
You mentioned that you start eclipse from the command line. Could you
please copy/paste the exact command you are using to start eclipse?


Danish Innis wrote:

> Hi,

> I'm new to eclipse so please forgive me if I've emailed the wrong group.
> I'm trying to build eclipse 3.2/cdt 3.1 on windows 2000 from the command
> line. I have both java 1.4 and 1.5 installed, I'm building with java 1.4
> as the default. I keep getting the errors below when compiling the jdt
> plugins:

> 1. ERROR in
>
E:buildforgeCCE3.1pluginsorg.eclipse.jdt.junit4.runtimesrcor geclipsejdtinternaljunit4runnerJUnit4Identifier.java
> [java] [javac] (at line 29)
> [java] [javac] @Override
> [java] [javac] ^^^^^^^^^
> [java] [javac] Syntax error, annotations are only available if
> source level is 5.0

> I googled the issue, saw there was one bug filed in Feb., tried to follow
> their solution (was for linux) but it doesn't work.

> I have tried adding the javacSource property set to 1.5 in my build.xml
> I have tried passing in -Djava5home to eclipse.antrunner.
> I have tried changing the java version to 1.5.

> Nothing seems to change the error message. I know I'm missing something,
> or there'd be a lot more out there regarding this issue, but I'm really
> stumped.

> If anyone can point me in the right direction, I'd be eternally grateful!
> thanks,
> Danish
Re: Syntax error, annotations are only available if source level is 5.0 [message #167401 is a reply to message #167293] Fri, 25 August 2006 13:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: d-innis.ti.com

kiril mitov wrote:

> Hi Danish,
> You mentioned that you start eclipse from the command line. Could you
> please copy/paste the exact command you are using to start eclipse?


> Danish Innis wrote:

>> Hi,

>> I'm new to eclipse so please forgive me if I've emailed the wrong group.
>> I'm trying to build eclipse 3.2/cdt 3.1 on windows 2000 from the command
>> line. I have both java 1.4 and 1.5 installed, I'm building with java 1.4
>> as the default. I keep getting the errors below when compiling the jdt
>> plugins:

>> 1. ERROR in
>>
>
E:buildforgeCCE3.1pluginsorg.eclipse.jdt.junit4.runtimesrcor geclipsejdtinternaljunit4runnerJUnit4Identifier.java
>> [java] [javac] (at line 29)
>> [java] [javac] @Override
>> [java] [javac] ^^^^^^^^^
>> [java] [javac] Syntax error, annotations are only available if
>> source level is 5.0

>> I googled the issue, saw there was one bug filed in Feb., tried to follow
>> their solution (was for linux) but it doesn't work.

>> I have tried adding the javacSource property set to 1.5 in my build.xml
>> I have tried passing in -Djava5home to eclipse.antrunner.
>> I have tried changing the java version to 1.5.

>> Nothing seems to change the error message. I know I'm missing something,
>> or there'd be a lot more out there regarding this issue, but I'm really
>> stumped.

>> If anyone can point me in the right direction, I'd be eternally grateful!
>> thanks,
>> Danish
Hi Kiril,

I'm trying to set up automated builds.

I run a batch file that has the following command, where the ant version
is 1.6.5:

%ANT_HOME%\bin\ant -DFLAG_CLEAN=true -DFLAG_UPDATE=true -DFLAG_BUILD=true
-DFLAG_TEST=true -DbuildDirectory "E:/buildforge/CCE3.1" -logfile
eclipse_build_log.txt

The ant build script runs:

<target name="Eclipse.AntRunner">
<java classname="org.eclipse.core.launcher.Main"
fork="true"
failonerror="true">
<classpath>
<pathelement
location=" ${VOBROOT}/eclipse/org.eclipse.releng.basebuilder/startup.ja r "/>
</classpath>

<arg line="-application org.eclipse.ant.core.antRunner
-buildfile ${pde.build.scripts}/build.xml
-DbuildDirectory=${buildDirectory}
-Dbuilder=${builder}
-Djava5home=${java5home}
-DbuildLabel=${buildLabel}
-DbuildId=${buildId}
-DbuildingOSGI=${buildingOSGI}
-Dpde.build.scripts=${pde.build.scripts}
-DfetchTag=${VOBROOT}
-Declipse.build.scripts=${eclipse.build.scripts}
-Dconfigs=${configs}
-DbranchVersion=${branchVersion}
-DarchivePrefix=${archivePrefix}
-DcollectingFolder=${collectingFolder}
-DbaseLocation=${baseLocation} "/>
</java>
</target>

Every other plugin builds fine, it's just the jdt that has the errors.
Thanks for the reply, I'm really foxed here.

Danish
Re: Syntax error, annotations are only available if source level is 5.0 [message #167440 is a reply to message #167401] Fri, 25 August 2006 15:52 Go to previous messageGo to next message
kiril mitov is currently offline kiril mitovFriend
Messages: 128
Registered: July 2009
Senior Member
My knowledge of ant "finishes" somewhere here...
But ant is a script. When it is runned it sets the properties of the
enviroment. If this properties are not set correctly than the build wont
be succesult. The java compiler has two options that you might considre:

"-source release
Enables support for compiling source code containing assertions.
The following values for release are allowed:
1.5 the compiler accepts code containing generics and other language
features introduced in JDK 1.5. The compiler defaults
to the 1.5 behavior if the -source flag is not used."

"-target version
Generates class files that will work on VMs with the specified
version. The default is to generate class files to be compati-
ble with 1.2 VMs, with one exception. When the -source 1.4
option is used, the default target is 1.4. The versions supported
by javac are:
1.1 Ensures that generated class files will be compatible with
1.1 and later. VMs.
1.2 Generates class files that will run on 1.2 and later VMs,
but will not run on 1.1 VMs.
1.3 Generates class files that run on VMs in the Java 2 SDK,
v1.3 and later, but will not run on 1.1 or 1.2 VMs.
1.4 Generates class files that will run on VMs in JDK 1.4 and
later, but will not run on 1.1, 1.2, or 1.3 VMs.
1.5 Generate class files that are compatible only with JDK 1.5
VMs.
5 Synonym for 1.5"

kiril.mitov

> I'm trying to set up automated builds.

> I run a batch file that has the following command, where the ant version
> is 1.6.5:

> %ANT_HOME%binant -DFLAG_CLEAN=true -DFLAG_UPDATE=true -DFLAG_BUILD=true
> -DFLAG_TEST=true -DbuildDirectory "E:/buildforge/CCE3.1" -logfile
> eclipse_build_log.txt

> The ant build script runs:

> <target name="Eclipse.AntRunner">
> <java classname="org.eclipse.core.launcher.Main"
> fork="true"
> failonerror="true">
> <classpath>
> <pathelement
> location=" ${VOBROOT}/eclipse/org.eclipse.releng.basebuilder/startup.ja r "/>
> </classpath>

> <arg line="-application org.eclipse.ant.core.antRunner
> -buildfile ${pde.build.scripts}/build.xml
> -DbuildDirectory=${buildDirectory}
> -Dbuilder=${builder}
> -Djava5home=${java5home}
> -DbuildLabel=${buildLabel}
> -DbuildId=${buildId}
> -DbuildingOSGI=${buildingOSGI}
> -Dpde.build.scripts=${pde.build.scripts}
> -DfetchTag=${VOBROOT}
> -Declipse.build.scripts=${eclipse.build.scripts}
> -Dconfigs=${configs}
> -DbranchVersion=${branchVersion}
> -DarchivePrefix=${archivePrefix}
> -DcollectingFolder=${collectingFolder}
> -DbaseLocation=${baseLocation} "/>
> </java>
> </target>

> Every other plugin builds fine, it's just the jdt that has the errors.
> Thanks for the reply, I'm really foxed here.

> Danish
Re: Syntax error, annotations are only available if source level is 5.0 - solved [message #170067 is a reply to message #167440] Fri, 08 September 2006 17:29 Go to previous message
Eclipse UserFriend
Originally posted by: d-innis.ti.com

kiril mitov wrote:

> My knowledge of ant "finishes" somewhere here...
> But ant is a script. When it is runned it sets the properties of the
> enviroment. If this properties are not set correctly than the build wont
> be succesult. The java compiler has two options that you might considre:

> "-source release
> Enables support for compiling source code containing assertions.
> The following values for release are allowed:
> 1.5 the compiler accepts code containing generics and other language
> features introduced in JDK 1.5. The compiler defaults
> to the 1.5 behavior if the -source flag is not used."

> "-target version
> Generates class files that will work on VMs with the specified
> version. The default is to generate class files to be compati-
> ble with 1.2 VMs, with one exception. When the -source 1.4
> option is used, the default target is 1.4. The versions supported
> by javac are:
> 1.1 Ensures that generated class files will be compatible with
> 1.1 and later. VMs.
> 1.2 Generates class files that will run on 1.2 and later VMs,
> but will not run on 1.1 VMs.
> 1.3 Generates class files that run on VMs in the Java 2 SDK,
> v1.3 and later, but will not run on 1.1 or 1.2 VMs.
> 1.4 Generates class files that will run on VMs in JDK 1.4 and
> later, but will not run on 1.1, 1.2, or 1.3 VMs.
> 1.5 Generate class files that are compatible only with JDK 1.5
> VMs.
> 5 Synonym for 1.5"

> kiril.mitov

>> I'm trying to set up automated builds.

>> I run a batch file that has the following command, where the ant version
>> is 1.6.5:

>> %ANT_HOME%binant -DFLAG_CLEAN=true -DFLAG_UPDATE=true -DFLAG_BUILD=true
>> -DFLAG_TEST=true -DbuildDirectory "E:/buildforge/CCE3.1" -logfile
>> eclipse_build_log.txt

>> The ant build script runs:

>> <target name="Eclipse.AntRunner">
>> <java classname="org.eclipse.core.launcher.Main"
>> fork="true"
>> failonerror="true">
>> <classpath>
>> <pathelement
>> location=" ${VOBROOT}/eclipse/org.eclipse.releng.basebuilder/startup.ja r "/>
>> </classpath>

>> <arg line="-application org.eclipse.ant.core.antRunner
>> -buildfile ${pde.build.scripts}/build.xml
>> -DbuildDirectory=${buildDirectory}
>> -Dbuilder=${builder}
>> -Djava5home=${java5home}
>> -DbuildLabel=${buildLabel}
>> -DbuildId=${buildId}
>> -DbuildingOSGI=${buildingOSGI}
>> -Dpde.build.scripts=${pde.build.scripts}
>> -DfetchTag=${VOBROOT}
>> -Declipse.build.scripts=${eclipse.build.scripts}
>> -Dconfigs=${configs}
>> -DbranchVersion=${branchVersion}
>> -DarchivePrefix=${archivePrefix}
>> -DcollectingFolder=${collectingFolder}
>> -DbaseLocation=${baseLocation} "/>
>> </java>
>> </target>

>> Every other plugin builds fine, it's just the jdt that has the errors.
>> Thanks for the reply, I'm really foxed here.

>> Danish
Hi,

Just FYI, I added javacSource=1.5 and javacTarget=1.5 to the plug-ins that
required source level 5.0.

Danish Innis
Previous Topic:sharing workspaces
Next Topic:Eclipse 3.2 doesn't run when built from source code
Goto Forum:
  


Current Time: Thu Apr 25 03:42:40 GMT 2024

Powered by FUDForum. Page generated in 0.07995 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top