Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/314.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Eclipse中编译任何java代码都有困难_Java_Eclipse_Compilation - Fatal编程技术网

在Eclipse中编译任何java代码都有困难

在Eclipse中编译任何java代码都有困难,java,eclipse,compilation,Java,Eclipse,Compilation,我是java世界的新手,一直在学习一些在线教程。一切都进行得很顺利,程序编译得很完美,然后突然间,我似乎没有改变任何东西,就直接归因于Eclipse的首选项而言,它停止编译任何代码。即使是简单的Hello World代码也无法编译。对于任何代码,我在控制台行中得到的都是: Usage: javaw [-options] class [args...] (to execute a class) or javaw [-options] -jar jarfile [args...]

我是java世界的新手,一直在学习一些在线教程。一切都进行得很顺利,程序编译得很完美,然后突然间,我似乎没有改变任何东西,就直接归因于Eclipse的首选项而言,它停止编译任何代码。即使是简单的Hello World代码也无法编译。对于任何代码,我在控制台行中得到的都是:

Usage: javaw [-options] class [args...]
       (to execute a class)
or  javaw [-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
用法:javaw[-options]类[args…] (执行一个类) 或javaw[-options]-jar-jarfile[args…] (执行jar文件) 其中包括: -d32使用32位数据模型(如果可用) -d64使用64位数据模型(如果可用) -选择“服务器”虚拟机的服务器 -hotspot是“服务器”VM的同义词[已弃用] 默认VM是服务器。 -cp -类路径 A.单独的目录列表、JAR归档、, 和压缩档案以搜索类文件。 -D= 设置系统属性 -详细[:类| gc | jni] 启用详细输出 -版本打印产品版本并退出 -版本: 需要指定的版本才能运行 -showversion打印产品版本并继续 -jre限制搜索|-无jre限制搜索 在版本搜索中包括/排除用户专用JRE -? -帮助打印此帮助消息 -关于非标准选项的X打印帮助 -ea[:…|:] -启用评估[:…|:] 启用具有指定粒度的断言 -da[:…;:] -取消分配[:…|:] 禁用具有指定粒度的断言 -esa |-启用系统断言 启用系统断言 -dsa |-禁用系统断言 禁用系统断言 -agentlib:[=] 加载本机代理库,例如-agentlib:hprof 另请参见-agentlib:jdwp=help和-agentlib:hprof=help -代理路径:[=] 按完整路径名加载本机代理库 -javaagent:[=] 加载Java编程语言代理,请参阅Java.lang.instrument -飞溅: 用指定的图像显示启动屏幕 有关更多详细信息,请参阅


我不太清楚这是什么,也不清楚它为什么开始这么做。我如何着手修复编译器,以便继续学习?

我也有这个问题。尝试重新启动Eclipse。如果不起作用,请重新启动计算机。如果连这都不行,请重新安装Java。这是一个恼人的错误,通常发生在你的计算机在Eclipse上运行程序时进入待机状态

编辑:如果问题仍然存在,您可以编写一个小的javac程序来编译给定目录中的任何代码


希望我能帮忙

之所以会出现这种情况,是因为您没有安装JDK,只有JRE。安装JDK以使其正常工作


为初学者提供的一个关于Eclipse的好教程位于。请运行所述步骤并检查其是否有效。如果没有,那么我们将了解可能的错误。我尝试重新启动Eclipse、我的计算机、重新安装Eclipse和重新安装Java。我仍然会显示相同的错误消息。我一直在遵循他的教程,并完全遵循他的指南。我不明白,到底是什么原因导致了这些问题如此突然。看看控制台的响应,我建议您尝试以下方法:制作一个使用javac命令的批处理文件,看看是否有效。如果仍然没有,我建议您向Eclipse提交一个bug报告。我通过javac命令成功编译了一个批处理文件,所以我想我一直在发送bug报告。谢谢你的建议和帮助。