簡體   English   中英

JCreator IDE:程序將編譯但不運行,在命令提示符下工作

[英]JCreator IDE: Program will compile but not run, works in command prompt

最近購買了一台新電腦,試圖恢復開發Java。 我使用的其中一個IDE,JCreator,已經開始向我吐出錯誤。 我在新機器上卸載並重新安裝了Java幾次以使一切正常。

我有一個語法正確的程序,編譯得很好,但每當我嘗試從IDE中運行程序時,它會發出錯誤消息。 內容如下:

--------------------Configuration: <Default>--------------------
Usage: java [-options] class [args...]
       (to execute a class)
   or  java [-options] -jar jarfile [args...]
       (to execute a jar file)
where options include:
-d32      use a 32-bit data model if available
-d64      use a 64-bit data model if available
-server   to select the "server" VM
-hotspot      is a synonym for the "server" VM  [deprecated]
              The default VM is server.

-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
              A ; separated list of directories, JAR archives,
              and ZIP archives to search for class files.
-D<name>=<value>
              set a system property
-verbose[:class|gc|jni]
              enable verbose output
-version      print product version and exit
-version:<value>
              require the specified version to run
-showversion  print product version and continue
-jre-restrict-search | -no-jre-restrict-search
              include/exclude user private JREs in the version search
-? -help      print this help message
-X            print help on non-standard options
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
              enable assertions with specified granularity
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
              disable assertions with specified granularity
-esa | -enablesystemassertions
              enable system assertions
-dsa | -disablesystemassertions
              disable system assertions
-agentlib:<libname>[=<options>]
              load native agent library <libname>, e.g. -agentlib:hprof
              see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:<pathname>[=<options>]
              load native agent library by full pathname
-javaagent:<jarpath>[=<options>]
              load Java programming language agent, see java.lang.instrument
-splash:<imagepath>
              show splash screen with specified image
See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.

Process completed.

我假設這只是如何連接運行時環境的說明。

踢球者是所有運行時設置:

配置>選項> JDK工具>運行應用程序

在我的舊機器上完全相同,運行一切都很好。 我知道這必須是一個JCreator問題,因為我可以從命令行完全編譯所有內容,然后運行它。

javac和java命令在命令行中工作,只有這一件事在JCreator中不起作用。

有關解決此問題的最佳方法的任何想法?

這是JCreator開發人員所知道的問題,並且正在嘗試尋找解決方案。 關於JCreator論壇的討論

通過Windows資源管理器打開文件時存在問題。

為了不遇到這個問題:打開JCreator。 打開文件( 不要關閉JCreator Start Page選項卡 )。

只要“起始頁”選項卡處於打開狀態(並處於第一個位置),您就可以毫無問題地運行文件。

您要做的最好的事情是復制所有源代碼,創建一個全新的項目,通過源代碼,然后構建它。

我有這個問題,我厭倦了,這是一個非常大的問題。

原因是您必須知道Jcreator適用於x86架構,因此您必須安裝32位Java版本,並且在Jcreator的配置中,您必須選擇32位版本的Java的路徑

(C:\\ Program Files(x86)\\ Java \\ jdk1.8.0_66)

任何時候您可能會收到此錯誤,請確保在Jcreator的配置中檢查Java的路徑。 這解決了我的問題,希望它有效。

暫無
暫無

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

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