最近重新看Java,别人推荐了一款轻量级的IDE,没错,就是JCreator。
它主要有两个版本:Pro和LE版本,其中Pro收费,LE版免费,但是功能相对于Pro更不齐全。
我下载的是csdn上的Pro破解版,传送门:http://download.csdn.net/download/liujun13579/4430786
安装完后感觉蛮不错的,又小又快,界面有点模范vs的感觉~
废话不多说,先说说问题:
情形:某个文件夹中有一个test.java文件,我双击打开(默认使用JCreator),但是当我F5编译和运行时,
问题出现了。
首先是编译,没有问题,编译成功,也产生了.class文件
然后调转到运行窗口,问题来了:
--------------------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.co...tion/index.html for more details.
以上明显就是你在命令行输入java时出现的帮助文档,我就在想可能是配置出了问题:
于是在Configure中检查,没有发现问题...
于是我打开了Options-->JDK Tools-->run application中的show command line,想看看具体的命令
再次运行,果然,问题出现了:
以下是执行的命令:
Command : "D:\jdk\bin\java.exe" -classpath "F:\学习笔记\java学习笔记\java代码\test;D:\jdk\jre\lib\rt.jar;D:\jdk\lib\dt.jar;D:\jdk\lib\tools.jar;D:\jdk\jre\lib\ext\dnsns.jar;D:\jdk\jre\lib\ext\localedata.jar;D:\jdk\jre\lib\ext\sunjce_provider.jar;D:\jdk\jre\lib\ext\sunmscapi.jar;D:\jdk\jre\lib\ext\sunpkcs11.jar"
你是否发现好像少了点什么?没错,怎么最后没有跟文件名啊!!
正常情况应该是(java test),但在这里test不见了~~
问题是发现了,但是如何解决呢?
于是我就在百度上查找,但是很多都是错误的答案,于是俺就上Google找,
输入 JCreator can‘t run,查询,google果然不负我啊,第一条就是答案~
以下是老外的原文:
Posted 11 February 2012 - 06:20 AM