---
title: "Syntax error, annotations are only available if source level is 5.0"
author: "编程足球"
date: "2011-07-24T11:52:50Z"
tags: []
categories: ["编程语言"]
slug: "syntax-error-annotations-are-only-available-if-source-level-is-5-0"
draft: false
lastmod: "2011-07-24T11:52:50Z"
id: 1129474
url: "https://lingf.iteye.com/blog/1129474"
---

在安装旧 版本的Myeclipse 或则eclipse,当加载新以前写的代码时候会出现下面的错误

```java

Syntax error, annotations are only available if source level is 5.0

```

注释版本最低要求5.0以上才可以用
意思是说你的编译版本太低了。可能是你安装的Myeclipse或则eclipse是比较旧的版本。
默认的编译jdk可能就是1.4
可以在  系统设置中进行修改
如图：
![](http://lingf.iteye.com/upload/picture/pic/94898/b2725276-fb68-36a7-bb43-17591495371e.jpg)
修改为5.0以上就可以了（必须有5.0以上的jdk)