有人能帮我吗?我试图上传一个项目在 Spring 启动非常简单,但我不成功,它不让项目上传,因为这个错误出现,有人能帮助我吗?
MAVEN:apache-maven-3.1.0
JAVA:17
- ————————————————-
ApacheMaven 3.1.0
Maven主页:C:\ApacheMaven主页-3.1.0
Java版本:17、供应商:甲骨文公司
Java主页:C:\程序文件\Java\jdk-17 - ————————————————-
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.2</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>com.prestes</groupId>
<artifactId>crudaplication</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>crudaplication</name>
<description>Projeto em Spring Boot</description>
<properties>
<java.version>17</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.ibm.informix/informix-jdbc-complete -->
<dependency>
<groupId>com.ibm.informix</groupId>
<artifactId>jdbc</artifactId>
<version>4.50.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
</plugin>
</plugins>
</build>
</project>
enter image description here
我需要帮助....................
1条答案
按热度按时间5lhxktic1#
您只需要使用以下方法之一设置所需的Java版本:
system.properties
根据官方文件:https://devcenter.heroku.com/articles/java-support#specifying-a-java-version你只需要创建一个文件system.properties,靠近你的pom.xml,并带有所需的版本(在你的例子中是17):
heroku maven插件
根据官方文件:
使用heroku maven插件,你可以设置高级heroku配置,如jdk版本: