Home » Modeling » EMF » Error: "annotations are only available if source level is 1.5"
|
Re: Error: "annotations are only available if source level is 1.5" [message #656054 is a reply to message #656051] |
Wed, 23 February 2011 22:06 |
Neil Bartlett Messages: 93 Registered: July 2009 |
Member |
|
|
In fact this problem is also happening even on a completely
straightforward "by the book" PDE project.
I can only ever generate model code once. After that, EMF chokes on the
annotations in its own generated code.
Regards,
Neil
On 23/02/2011 21:46, Neil Bartlett wrote:
> Hi, I'm having more adventures with EMF in a non-plugin project.
>
> After generating my model code for the first time, I am unable to reload
> the genmodel from the annotated Java. Looking in the error log, I
> noticed this error:
>
> "A problem was detected while parsing a Java fileLine 60: Syntax error,
> annotations are only available if source level is 1.5
> Line 105: Syntax error, annotations are only available if source level
> is 1.5"
>
> However the project definitely is at source level 1.5. From my
> .settings/org.eclipse.jdt.core.prefs:
>
> org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
> org.eclipse.jdt.core.compiler.compliance=1.5
> org.eclipse.jdt.core.compiler.source=1.5
>
> And from my .classpath:
>
> <classpathentry kind="con"
> path=" org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.inte rnal.debug.ui.launcher.StandardVMType/J2SE-1.5 "/>
>
>
> So, where is EMF getting the idea that this project is not at source
> level 1.5? And why does this problem only happen after I generate model
> code for the first time?
>
> Many thanks,
> Neil
|
|
|
Re: Error: "annotations are only available if source level is 1.5" [message #656063 is a reply to message #656054] |
Thu, 24 February 2011 00:10 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
Neil,
Maybe the MANIFEST.MF has contradictory settings? (Which seems related
to your previous question.)
Neil Bartlett wrote:
> In fact this problem is also happening even on a completely
> straightforward "by the book" PDE project.
>
> I can only ever generate model code once. After that, EMF chokes on
> the annotations in its own generated code.
>
> Regards,
> Neil
>
>
> On 23/02/2011 21:46, Neil Bartlett wrote:
>> Hi, I'm having more adventures with EMF in a non-plugin project.
>>
>> After generating my model code for the first time, I am unable to reload
>> the genmodel from the annotated Java. Looking in the error log, I
>> noticed this error:
>>
>> "A problem was detected while parsing a Java fileLine 60: Syntax error,
>> annotations are only available if source level is 1.5
>> Line 105: Syntax error, annotations are only available if source level
>> is 1.5"
>>
>> However the project definitely is at source level 1.5. From my
>> .settings/org.eclipse.jdt.core.prefs:
>>
>> org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
>> org.eclipse.jdt.core.compiler.compliance=1.5
>> org.eclipse.jdt.core.compiler.source=1.5
>>
>> And from my .classpath:
>>
>> <classpathentry kind="con"
>> path=" org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.inte rnal.debug.ui.launcher.StandardVMType/J2SE-1.5 "/>
>>
>>
>>
>> So, where is EMF getting the idea that this project is not at source
>> level 1.5? And why does this problem only happen after I generate model
>> code for the first time?
>>
>> Many thanks,
>> Neil
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: Error: "annotations are only available if source level is 1.5" [message #656064 is a reply to message #656054] |
Thu, 24 February 2011 00:10 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
Neil,
Maybe the MANIFEST.MF has contradictory settings? (Which seems related
to your previous question.)
Neil Bartlett wrote:
> In fact this problem is also happening even on a completely
> straightforward "by the book" PDE project.
>
> I can only ever generate model code once. After that, EMF chokes on
> the annotations in its own generated code.
>
> Regards,
> Neil
>
>
> On 23/02/2011 21:46, Neil Bartlett wrote:
>> Hi, I'm having more adventures with EMF in a non-plugin project.
>>
>> After generating my model code for the first time, I am unable to reload
>> the genmodel from the annotated Java. Looking in the error log, I
>> noticed this error:
>>
>> "A problem was detected while parsing a Java fileLine 60: Syntax error,
>> annotations are only available if source level is 1.5
>> Line 105: Syntax error, annotations are only available if source level
>> is 1.5"
>>
>> However the project definitely is at source level 1.5. From my
>> .settings/org.eclipse.jdt.core.prefs:
>>
>> org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
>> org.eclipse.jdt.core.compiler.compliance=1.5
>> org.eclipse.jdt.core.compiler.source=1.5
>>
>> And from my .classpath:
>>
>> <classpathentry kind="con"
>> path=" org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.inte rnal.debug.ui.launcher.StandardVMType/J2SE-1.5 "/>
>>
>>
>>
>> So, where is EMF getting the idea that this project is not at source
>> level 1.5? And why does this problem only happen after I generate model
>> code for the first time?
>>
>> Many thanks,
>> Neil
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: Error: "annotations are only available if source level is 1.5" [message #656310 is a reply to message #656063] |
Fri, 25 February 2011 01:12 |
Neil Bartlett Messages: 93 Registered: July 2009 |
Member |
|
|
Ed, comment below.
On 24/02/2011 00:10, Ed Merks wrote:
> Neil,
>
> Maybe the MANIFEST.MF has contradictory settings? (Which seems related
> to your previous question.)
No it has nothing to do with that at all. EMF is barfing even in a
completely conventional PDE project.
I suspect there was something wrong with the workspace or the Eclipse
installation. After creating a new workspace and installing EMF tooling
into a new Eclipse, everything works again. Go figure :-/
Neil
>
>
> Neil Bartlett wrote:
>> In fact this problem is also happening even on a completely
>> straightforward "by the book" PDE project.
>>
>> I can only ever generate model code once. After that, EMF chokes on
>> the annotations in its own generated code.
>>
>> Regards,
>> Neil
>>
>>
>> On 23/02/2011 21:46, Neil Bartlett wrote:
>>> Hi, I'm having more adventures with EMF in a non-plugin project.
>>>
>>> After generating my model code for the first time, I am unable to reload
>>> the genmodel from the annotated Java. Looking in the error log, I
>>> noticed this error:
>>>
>>> "A problem was detected while parsing a Java fileLine 60: Syntax error,
>>> annotations are only available if source level is 1.5
>>> Line 105: Syntax error, annotations are only available if source level
>>> is 1.5"
>>>
>>> However the project definitely is at source level 1.5. From my
>>> .settings/org.eclipse.jdt.core.prefs:
>>>
>>> org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
>>> org.eclipse.jdt.core.compiler.compliance=1.5
>>> org.eclipse.jdt.core.compiler.source=1.5
>>>
>>> And from my .classpath:
>>>
>>> <classpathentry kind="con"
>>> path=" org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.inte rnal.debug.ui.launcher.StandardVMType/J2SE-1.5 "/>
>>>
>>>
>>>
>>> So, where is EMF getting the idea that this project is not at source
>>> level 1.5? And why does this problem only happen after I generate model
>>> code for the first time?
>>>
>>> Many thanks,
>>> Neil
>>
|
|
| | | | | | | |
Re: Error: &quot;annotations are only available if source level is 1.5&quot; [message #930209 is a reply to message #929585] |
Tue, 02 October 2012 05:30 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
There is a long thread in that bugzilla; I'm not sure if you tried all
those things. In any case, something about your JDT settings or your
installed JREs must be a little off, but I can't guess that from what
you've said.
On 01/10/2012 5:31 PM, Peter Rimshnick wrote:
> I'm having the same problem, even though I'm using EMF 2.8. Curiously,
> when the genModel compliance level is set to 1.4, I get three errors
> of this type, but when I set it to 50 or above I get many more errors
> of this type. My project compliance is set to 1.5, my JRE is 60.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Goto Forum:
Current Time: Tue Apr 23 13:24:40 GMT 2024
Powered by FUDForum. Page generated in 0.03598 seconds
|