国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

Command line is too long

這篇具有很好參考價值的文章主要介紹了Command line is too long。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

目錄

一、遇到的問題

二、使用環(huán)境

三、問題分析

四、解決方案

1、解決方式一

2、解決方式二


一、遇到的問題

上周五,我要改造一個之前從未接觸過的 SpringBoot 項目。我用 git 拉下代碼后,試圖使用 Idea 運行它。但是,Idea 在運行時拋出了一個問題:Error running 'Application': Command line is too long. Shorten command line for Application or also for Application default configuration?

該問題一般會在新項目或者從未接觸過的項目上出現(xiàn)。雖然網(wǎng)上有很多的解決方案,但很多解決方案都已經(jīng)過時。并且這些方案也沒有講清問題的原因,所以我打算先用一個簡單的 SpringBoot 項目模擬出該問題,再解決它,這樣就很容易分析該問題。我覺得有必要寫一篇文章記錄這個過程,也可以幫助到遇到該問題的開發(fā)者。

Command line is too long

二、使用環(huán)境

我使用的操作系統(tǒng)是 Windows, Idea 的版本是:IntelliJ IDEA 2020.3.1 (Community Edition)

如果你遇到了該問題,先看一下你使用的 Idea 是多少版本的。2017.3 及以后的版本都可以使用該方法解決問題,如果你是 2017.3 之前的版本,我建議你升級 Idea ,盡量使用新版本的 Idea 。

Command line is too long

三、問題分析

我先問一個問題,在 Idea 中點擊運行按鈕后,Idea 會調(diào)用哪些命令?

當(dāng)我們點擊運行程序的按鈕,Idea 會先調(diào)用 javac 命令編譯程序,再調(diào)用 java 命令運行程序。

現(xiàn)在,分析一下錯誤:Error running 'Application': Command line is too long 。這個錯誤說的很明確,運行程序時報錯,命令行太長了,而運行程序的命令就是上面說的 java 命令。最后的結(jié)論是,運行 java 的命令行太長。一般來說,操作系統(tǒng)有命令行長度限制,超過限制的長度就會執(zhí)行失敗。

下面來證明我的結(jié)論,在 Idea 中運行程序,控制臺中打印的第一行日志如下圖中紅框所示:

Command line is too long

Command line is too long

該行日志就是使用 java 命令運行程序,點開后可以看到后面跟有 -javaagent、classpath 等參數(shù)。如果 classpath 中包含的 jar 包過多,可能導(dǎo)致命令行過長。

四、解決方案

既然知道了是 java 命令行太長,導(dǎo)致運行程序失敗。只要縮短命令行就可以解決該問題,Idea 2017.3 之后的版本提供了縮短命令行的配置。如下有兩種解決方式,方式一和方式二的原理一樣,都是配置縮短命令行。方式一和方式二的區(qū)別在于方式一是按步驟配置,方式二是快速配置。

1、解決方式一

先打開 Run/Debug Configurations 面板。再點擊 Modify options ,選擇 Shorten command line ,再選擇 JAR manifest 或者 classpath file 就可以解決問題。

示意圖如下所示:

Command line is too long

Command line is too long

Command line is too long

2、解決方式二

如果你的 Idea 彈出報錯信息如下圖所示,直接點擊藍(lán)色的 JAR manifest 或者 classpath file 可以快速配置,再次運行程序就不會再報錯了。

Command line is too long文章來源地址http://www.zghlxwxcb.cn/news/detail-422921.html

到了這里,關(guān)于Command line is too long的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經(jīng)查實,立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費用

相關(guān)文章

  • IDEA:Error running,Command line is too long. Shorten command line解決方案

    IDEA:Error running,Command line is too long. Shorten command line解決方案

    原因是啟動命令過長 方案一: 1.在工程文件.idea目錄下找到workspace.xml 2.find查詢并定位到PropertiesComponent 3.添加代碼行 或另一種形式 4.CTRL+S保存確定 方案二: 1.打開Edit Configurations 2.點擊Modify options設(shè)置,勾選Shorten command line 3.在Edit Configurations界面下方新增的Shorten command line選項

    2024年02月12日
    瀏覽(25)
  • idea 啟動報錯 Command line is too long

    idea 啟動報錯 Command line is too long

    啟動報錯信息: Error running ‘Application‘: Command line is too long. 翻譯過來就是:啟動命令過長! 解決方案 1、點開項目啟動配置項目; 2、 shorten command line 選項選擇 JAR manifest 或者 classpath file 選項,點擊 Apply 和 OK,然后重啟項目; Error running test: Command line is too long 上面是運行

    2024年02月10日
    瀏覽(29)
  • IDEA:Error running,Command line is too long. 解決方法

    IDEA:Error running,Command line is too long. 解決方法

    報錯如下: 原因是啟動命令過長。 解決方法: 1、打開Edit Configurations 2、點擊Modify options設(shè)置,勾選Shorten command line 3、在Edit Configurations界面下方新增的Shorten command line選項中選擇JAR manifest或classpath file 然后 Apply,OK 即可。

    2024年02月01日
    瀏覽(18)
  • Intellij IDEA運行報Command line is too long的解決辦法

    Intellij IDEA運行報Command line is too long的解決辦法

    想哭,vue前端運行起來,對應(yīng)的后端也得起服務(wù)。 后端出的這個bug,下面的博客寫的第二種方法,完整截圖是下面這個。 ????????????????????Intellij IDEA運行報Command line is too long的解決辦法 - 知乎 (zhihu.com)??????? ???????? ? ?

    2024年02月14日
    瀏覽(18)
  • idea Error running Application. Command line is too long. Shorten the command line via JAR manifest

    idea Error running Application. Command line is too long. Shorten the command line via JAR manifest

    idea內(nèi)容太長報錯 報錯: Error running Application. Command line is too long. Shorten the command line via JAR manifest or via a classpath file and rerun. 解決方法: 點擊“Edit Configurations...” ? 選擇左邊的一個應(yīng)用,點擊 “Modify options” ? 點擊 “Shorten command line” ?點擊 “Jar mainfest” ?點擊“Apply” 依

    2024年02月12日
    瀏覽(30)
  • 啟動springboot項目時命令行太長錯誤解決(Command line is too long)

    啟動springboot項目時命令行太長錯誤解決(Command line is too long)

    剛從git拉取的項目進行啟動時報錯,說命令行太長。 Error running ‘YudaoServerApplication’: Command line is too long. Shorten command line for YudaoServerApplication or also for Spring Boot default configuration. 1.選擇項目配置項 2.選擇 Configuration 菜單中的 Shorten command line 下拉框中的 JAR manifest 或者 classpat

    2024年02月12日
    瀏覽(20)
  • idea 中運行spring boot 項目報 Command line is too long的解決辦法。

    idea 中運行spring boot 項目報 Command line is too long的解決辦法。

    在這里選擇edit configures 選擇shrten command line , 選擇 jar manifest 運行即可。

    2024年04月12日
    瀏覽(25)
  • 解決使用git時遇到的“Filename too long“問題

    解決使用git時遇到的“Filename too long“問題

    【問題】 : ?git 命令操作提示Filename too long,一般是在windows下出現(xiàn)的問題。git可以創(chuàng)建4096長度的文件名,然而在windows最多是260。 【解決方案】 git bash命令窗口輸入 –global或者system是該參數(shù)的使用范圍,只想對本版本庫設(shè)置該參數(shù),上述命令中去掉–global或system。

    2024年02月08日
    瀏覽(22)
  • 遇到“c++: 錯誤:unrecognized command line option ‘-std=c++17’”,CentOS升級GCC版本以支持c++17

    編譯時遇到問題: c++: 錯誤:unrecognized command line option ‘-std=c++17’ 原因:GCC版本太低(CentOS7直接yum安裝的GCC版本為4.8.5) 參考:Linux怎樣更新Centos下Gcc版本支持C++17? 解決方案: 了解GCC版本及對C++版本的支持情況: GCC Releases GCC版本對C++的支持情況 C++ Standards Support in GCC 其

    2024年02月09日
    瀏覽(19)
  • goland報錯:“package command-line-arguments is not a main package”解決方案

    大家好!我是躺平哥。? ? ? ?? 今天模擬客戶端和服務(wù)端交互時遇到了一個問題: “package command-line-arguments is not a main package” ?????????翻譯過來就是包命令行參數(shù)不是主包 ? ? ? ? 因為在Go語言中,和java的main是有所區(qū)別的,具體區(qū)別如下: ????????在java中,任何

    2023年04月19日
    瀏覽(24)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包