当前位置: 代码迷 >> Java相关 >> [求助]Jcreator编写程序
  详细解决方案

[求助]Jcreator编写程序

热度:200   发布时间:2007-10-19 18:34:44.0
[求助]Jcreator编写程序

用Jcreator 4.0版本编写如下程序,但出现了问题。
public class Escape Sequences
{
public static void main(String args[])
{
System.out.println("Displaying single quotes:"+"\'A\'");
System.out.println("Displaying double quotes:"+"\"string\"");
System.out.println("Displaying a backslash:\\");
System.out.println("Text separate\t\tby two tabs");
System.out.println("Here is double\n\nspaced text");
System.out.println("**********\r#####");
}
}

问题如下:
C:\java exercise\Escape Sequences.java:1: 需要 '{'
public class Escape Sequences
^
1 错误

处理已完成。


--------------------配置: <--------------------
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)

where options include:
-client to select the "client" VM
-server to select the "server" VM
-hotspot is a synonym for the "client" VM [deprecated]
The default VM is client.

-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 | -jre-no-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
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
disable assertions
-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

处理已完成。

搜索更多相关的解决方案: Jcreator  println  System  

----------------解决方案--------------------------------------------------------
类名中间不能有空格
----------------解决方案--------------------------------------------------------
试过了,还是不行。
----------------解决方案--------------------------------------------------------

把空格去掉就OK了


----------------解决方案--------------------------------------------------------

把空格去掉,注意末尾还有个空格!


----------------解决方案--------------------------------------------------------
--------------------Configuration: <Default>--------------------
Displaying single quotes:'A'
Displaying double quotes:"string"
Displaying a backslash:\
Text separate       by two tabs
Here is double

spaced text
**********
#####

Process completed.

文件名和你的类名一致   

import java.io.*;
public class Escape Sequences
{
public static void main(String args[])
{
System.out.println("Displaying single quotes:"+"\'A\'");
System.out.println("Displaying double quotes:"+"\"string\"");
System.out.println("Displaying a backslash:\\");
System.out.println("Text separate\t\tby two tabs");
System.out.println("Here is double\n\nspaced text");
System.out.println("**********\r#####");
}
}

----------------解决方案--------------------------------------------------------
Error : Invalid path, C:\j2sdk1.4.2_16\bin\jdb.exe -classpath "E:\JCreator Pro\MyProjects\lbk\classes" hello"
这是怎么了
----------------解决方案--------------------------------------------------------
回复 7楼 圣斗士
变量没设置好!!自己去网上找怎么设置变量!
----------------解决方案--------------------------------------------------------
  相关解决方案