gpt4 book ai didi

java - JCreator IDE : Program will compile but not run, 在命令提示符下工作

转载 作者:行者123 更新时间:2023-11-29 03:43:39 25 4
gpt4 key购买 nike

最近买了一台新电脑,想继续开发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 开发人员已经意识到这个问题,并正在努力寻找解决方案。 Discussion on JCreator's forum board about this

当通过 Windows 资源管理器打开文件时存在问题。

为了不遇到这个问题:打开 JCreator。打开您的文件(不要关闭 JCreator Start Page 选项卡)。

只要“起始页”选项卡打开(并位于第一个位置),运行文件应该没有问题。

关于java - JCreator IDE : Program will compile but not run, 在命令提示符下工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12011447/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com