尝试在IntelliJ中使用Maven来运行Java/JavaFX。

huangapple 未分类评论42阅读模式
英文:

Trying to get maven up and running on intellij with java/javafx

问题

我正试图让Maven在我的计算机上正常工作。到目前为止,我大部分时间都避免使用它,但眼下我需要让它能够正常运行。我希望它能与JavaFX/Java一起工作。

我已经查阅了各种指南,尝试让它正常工作,但没有成功。

  1. 设置 -> 构建、执行、部署 -> 编译器 -> Java编译器 和 字节码版本/项目字节码版本
  2. 与项目设置相匹配 -> 项目 -> 项目SDK 和 项目语言级别

我遇到了错误:
错误:java:不再支持源选项5。请使用6或更高版本。

这是一个持续的问题。

我所做的:

  1. 创建一个JavaFX项目
  2. 导入所有依赖并使用VM选项将它们引用到正确的位置
  3. 在给定的项目文件夹上单击右键 -> 添加框架支持 -> Maven

感谢任何简单的解决方案。我已经查阅并尝试过的链接。

英文:

I am trying to get maven to work properly on my computer. Until now I have mostly avoided using it but for the time being i need to get it up and running. I want it working with javafx/java in general.

I have checked various guides trying to get it working but with no luck.

  1. Settings -> Build, Execution, Deployment -> Compiler -> Java Compiler & Bytecode version/Project Bytecode version
  2. Matched with Project Settings -> Project -> Project SDK & Project Language Level

I get the error:
Error:java: Source option 5 is no longer supported. Use 6 or later.

This is a continual problem.

What I do:

  1. Create a javafx project
  2. Import all dependencies and refer them to the right location with VM options
  3. Right-click given project folder -> Add framework support -> Maven

Appreciate any simple solutions. Links I have checked and tried.

答案1

得分: 0

<properties>
    <maven.compiler.target>1.6</maven.compiler.target>
    <maven.compiler.source>1.6</maven.compiler.source>
</properties>
英文:

In your pom you need to simply change the target/source to java 6 or higher.

<properties>
    <maven.compiler.target>1.6</maven.compiler.target>
    <maven.compiler.source>1.6</maven.compiler.source>
</properties>

huangapple
  • 本文由 发表于 2020年4月5日 11:23:07
  • 转载请务必保留本文链接:https://java.coder-hub.com/61037628.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定