繁体   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