简体   繁体   English

JCreator IDE:程序将编译但不运行,在命令提示符下工作

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

Recently purchased a new computer, trying to resume developing Java. 最近购买了一台新电脑,试图恢复开发Java。 One of the IDEs I use, JCreator, has started spitting out errors at me. 我使用的其中一个IDE,JCreator,已经开始向我吐出错误。 I uninstalled and reinstalled Java a few times on the new machine to get everything working. 我在新机器上卸载并重新安装了Java几次以使一切正常。

I have a syntactically correct program, compiles just fine, but whenever I try to run the program from within the IDE, it spits out an error message. 我有一个语法正确的程序,编译得很好,但每当我尝试从IDE中运行程序时,它会发出错误消息。 It reads as follows: 内容如下:

--------------------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.

I am assuming this is merely instructions for how to hook up the runtime environment. 我假设这只是如何连接运行时环境的说明。

The kicker is that all runtime settings under: 踢球者是所有运行时设置:

Configure > Options > JDK Tools > Run Application 配置>选项> JDK工具>运行应用程序

are the exact same on my old machine which runs everything just fine. 在我的旧机器上完全相同,运行一切都很好。 I know this has to be a JCreator problem because I can compile everything perfectly fine from command line and then run it. 我知道这必须是一个JCreator问题,因为我可以从命令行完全编译所有内容,然后运行它。

javac and java commands work in command line, just this one thing will not work in JCreator. javac和java命令在命令行中工作,只有这一件事在JCreator中不起作用。

Any ideas on the best way to resolve this? 有关解决此问题的最佳方法的任何想法?

This is a problem that JCreator developer's are aware of, and are trying to find a solution to. 这是JCreator开发人员所知道的问题,并且正在尝试寻找解决方案。 Discussion on JCreator's forum board about this 关于JCreator论坛的讨论

The problem exists when a file is opened through windows explorer. 通过Windows资源管理器打开文件时存在问题。

In order to not experience this problem: Open JCreator. 为了不遇到这个问题:打开JCreator。 Open your file ( do not close the JCreator Start Page tab ). 打开文件( 不要关闭JCreator Start Page选项卡 )。

You should have no problems running your file as long as the Start Page tab is open (and in the first position). 只要“起始页”选项卡处于打开状态(并处于第一个位置),您就可以毫无问题地运行文件。

您要做的最好的事情是复制所有源代码,创建一个全新的项目,通过源代码,然后构建它。

I had this problem and I was tired of it, this is a very huge problem. 我有这个问题,我厌倦了,这是一个非常大的问题。

The cause is that you have to know that Jcreator works on x86 architecture, so you must install 32-bit Java version, and in the configuration of Jcreator,you must choose the path of 32 bit version of Java 原因是您必须知道Jcreator适用于x86架构,因此您必须安装32位Java版本,并且在Jcreator的配置中,您必须选择32位版本的Java的路径

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

Any time you may get this error, make sure to check the path of Java in config of Jcreator. 任何时候您可能会收到此错误,请确保在Jcreator的配置中检查Java的路径。 This solved the problem for me, hope it works. 这解决了我的问题,希望它有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Java程序将编译但不能在命令提示符下运行 - Java program will compile but not run in command prompt Java 程序在命令提示符下成功编译并运行,但在 myeclips 中却没有? - Java Program compile and run in command prompt successfully but not in myeclips? 我无法通过命令提示符运行基本程序,但我可以通过 IDE 运行它 - I can't run a basic program through the command prompt, but I can run it through an IDE 我的 java 编译器在命令提示符下处理我的程序,但是当我尝试运行该程序时,它给了我一个错误 - My java compiler works on my program in the command prompt but when i try to run the program it gives me an error 是否需要从像IntelliJ这样的IDE编译整个程序才能从命令行运行? - Is It necessary to compile entire program from an IDE like IntelliJ to run from command line? Java程序在IDE中运行,但不在命令行中运行 - Java program works from the IDE but not the command line 在命令提示符下编译并运行Servlet - Compile and run Servlet from command prompt 从命令提示符编译并运行Eclipse Project - Compile and run Eclipse Project from command prompt 如何在命令提示符下运行Java程序 - How to run Java program in command prompt 如何在命令提示符下运行Java程序 - how to run a java program in command prompt
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM