簡體   English   中英

在 Ubuntu 中使用 javac 編譯時出錯

[英]Error while compiling with javac in Ubuntu

我正在嘗試在 Ubuntu 中編譯一些軟件來運行它。 我下載了它,我看到有一個 compile.bat 文件。 我試圖用 Wine 運行它,但我得到了一些錯誤。 之后,我使用與 compile.bat 文件相同的命令創建了一個 compile.sh 文件。 這些命令是:

javac -extdirs lib/ core/*.java
javac -extdirs lib/ movement/*.java
javac -extdirs lib/ report/*.java
javac -extdirs lib/ routing/*.java
javac -extdirs lib/ gui/*.java
javac -extdirs lib/ input/*.java
javac -extdirs lib/ applications/*.java
javac -extdirs lib/ interfaces/*.java

我嘗試運行 .sh 腳本,但出現此錯誤:

root@vbox:/media/sf_shared/one_1.4.1# ./compile.sh 
error: option -extdirs not allowed with target 11
error: option -extdirs not allowed with target 11
error: option -extdirs not allowed with target 11
error: option -extdirs not allowed with target 11
error: option -extdirs not allowed with target 11
error: option -extdirs not allowed with target 11
error: option -extdirs not allowed with target 11
error: option -extdirs not allowed with target 11

這些是我的 java 版本:

javac 11.0.4
/usr/bin/javac
openjdk version "11.0.4" 2019-07-16
OpenJDK Runtime Environment (build 11.0.4+11-post-Ubuntu-1ubuntu218.04.3)
OpenJDK 64-Bit Server VM (build 11.0.4+11-post-Ubuntu-1ubuntu218.04.3, mixed mode, sharing)
/usr/bin/java

似乎“extdirs”選項不存在。 但是,它被列為 javac 選項:

-extdirs <dirs>              Override location of installed extensions

root@vbox:/media/sf_shared/one_1.4.1# javac -extdirs
error: -extdirs requires an argument
Usage: javac <options> <source files>
use --help for a list of possible options

我該如何解決? 任何幫助都會很有用,因為我對 Java 不太了解。

正如@seconf 所說,更改為 java1.8 可以解決問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM