idea报错 Error:java: 不允许在使用 --release 时从系统模块 java.base 导出程序包:

img


代码:


package com.example.demo.controller;

import com.example.demo.dao.EmployeeDao;
import com.example.demo.entities.Employee;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.Collection;

@Controller
public class EmployeeController {
    @Autowired
    EmployeeDao employeeDao;

    //查询所有员工返回列表页面
    @GetMapping("/emps")
    public String list(Model model){
        Collection<Employee> employees=employeeDao.getAll();

        model.addAttribute("emps",employees);
        //thymeleaf默认会拼串   classpath:/templates/xxxxx.html
        return "emp/list";


    }
}

idea=>文件=》项目结构=》

img

img