在Eclipse中编译任何Java代码时遇到问题 [英] Trouble compiling any java code in Eclipse

查看:242
本文介绍了在Eclipse中编译任何Java代码时遇到问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是java的世界的新手,并且已经按照一些在线教程开始。一切都进行得很好,程序编译完全,然后突然,没有我似乎改变任何东西,就偏好直接归因于Eclipse,它停止编译任何代码。即使是简单的Hello World代码也不会编译。所有我在控制台行中为任何代码是:

I'm new to the world of java and have been following a few online tutorials to get started. Everything was going great and the programs were compiling perfectly and then all of a sudden, without me seemingly changing anything, as far as preferences directly attributing to Eclipse, it stopped compiling any code at all. Even the simple Hello World code will not compile. All I get in the console line for any code is:

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

请参阅 http://www.oracle.com/technetwork/java/javase/documentation/index.html 了解更多详细信息。

See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.

我不知道这是什么或为什么它开始做。我如何在修复编译器,以便我可以继续学习?

I'm not exactly sure of what this is or why it started doing it. How do I go about in fixing the compiler so I can continue to learn?

推荐答案

我也有这个问题。尝试重新启动Eclipse。如果这不工作,重新启动计算机。如果即使这样不工作,重新安装Java。

I too have had this problem. Try restarting Eclipse. If that doesn't work, restart your computer. If even that doesn't work, re-install Java. Its an annoying bug that usually occurs when your computer goes into standby while a program is running on Eclipse.

编辑:如果问题仍然存在,你可以做一个小的javac程序

If the problem persists, you can make a small javac program that would compile any code in a given directory.

希望我帮助了!

这篇关于在Eclipse中编译任何Java代码时遇到问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆