在Eclipse中编译任何java代码的麻烦 [英] Trouble compiling any java code in Eclipse

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

问题描述

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

 用法:javaw [-options] class [args ...] 
(执行一个类)
或javaw [-options] -jar jarfile [args ...]
(执行一个jar文件)
其中选项包括:
-d32使用32位数据模型(如果可用)
-d64使用64位数据模型(如果可用)
-server选择服务器VM
-hotspot是同义词对于服务器VM [已弃用]
默认的VM是服务器。

-cp<目录和zip / jar文件的类搜索路径>
-classpath<目录和zip / jar文件的类搜索路径>
A;目录分离列表,JAR存档,
和ZIP存档来搜索类文件。
-D< name> =< value>
设置系统属性
-verbose [:class | gc | jni]
启用详细输出
-version打印产品版本并退出
-version:< value> ;
要求指定的版本运行
-showversion打印产品版本并继续
-jre-restrict-search | -no-jre-restrict-search
在版本搜索中包含/排除用户私有JRE
- ? -help打印此帮助消息
-X在非标准选项上打印帮助
-ea [:< packagename> ... |:< classname>]
-enableassertions [:< ; packagename> ... |:< classname>]
启用具有指定粒度的断言
-da [:< packagename> ... |:< classname>]
-disableassertions [:< packagename> ... |:< classname>]
禁用具有指定粒度的断言
-esa | -enablesystemassertions
启用系统断言
-dsa | -disablesystemassertions
禁用系统断言
-agentlib:< libname> [=< options>]
加载本机代理库< libname> -agentlib:hprof
另请参见:-agentlib:jdwp = help和-agentlib:hprof = help
-agentpath:< pathname> [=< options>]
加载本机代理库通过完整路径名
-javaagent:< jarpath> [=< options>]
加载Java编程语言代理,请参阅java.lang.instrument
-splash:< imagepath>
显示具有指定图像的初始屏幕

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



我不太清楚这是什么,或者为什么开始这样做。修改编译器如何继续学习?

解决方案

这是因为您没有安装JDK但只有JR​​E。安装JDK以使其正常工作。




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

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?

解决方案

That happens because you haven't installed JDK but only JRE. Install JDK to make it work.

Source

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

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