maven编译出错,javac: ��Ч��Ŀ�귢�а�: 17

1、异常信息

javac: ��Ч��Ŀ�귢�а�: 17

�÷�: javac <options> <source files>

-help �����г����ܵ�ѡ��

2、原因

电脑安装了jdk1.8 ,项目编译指定jdk版本为17

解决方案1,修改电脑运行jdk版本

解决方案2,在spring项目pom文件中中指定jdk目录位置

复制代码
   <build>
        <plugins>  
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
                <configuration>
                    <verbose>true</verbose>
                    <fork>true</fork>
                    <executable>C:\ProgramFiles\jdk-17.0.12\bin\javac</executable>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                    <compilerArgs>
                        <arg>-XDignore.symbol.file</arg>
                    </compilerArgs>
                    <fork>true</fork>
                </configuration>
            </plugin>
         </plugins>
    </build>
相关推荐
天空属于哈夫克326 分钟前
企业微信API常见的错误和解决方案
java·数据库·企业微信
东风破13737 分钟前
DM8达梦数据库备份、恢复原理介绍
数据库·oracle·dm达梦数据库
鹏子训1 小时前
AI记忆新思路:用SQLite替代向量数据库,去EMBEDDINGS化,谷歌开源Google Always On Memory Agent
数据库·人工智能·sqlite·embedding
Frank_refuel1 小时前
终端环境下:Ubuntu 22.04.1 安装 MySQL 数据库
数据库·mysql·ubuntu
摇滚侠1 小时前
VMvare 虚拟机 Oracle19c 安装步骤,远程连接 Oracle19c,百度网盘安装包
java·oracle
梁萌1 小时前
idea报错找不到XX包的解决方法
java·intellij-idea·启动报错·缺少包
Agent产品评测局1 小时前
生产排期与MES/ERP系统打通,实操方法详解 —— 2026企业级智能体自动化选型与实战指南
java·运维·人工智能·ai·chatgpt·自动化
阿丰资源2 小时前
基于Spring Boot的电影城管理系统(直接运行)
java·spring boot·后端
呱牛do it2 小时前
企业级门户网站设计与实现:基于SpringBoot + Vue3的全栈解决方案(Day 8)
java
虹科网络安全2 小时前
艾体宝产品|深度解读 Redis 8.4 新增功能:原子化 Slot 迁移(下)
数据库·redis·bootstrap