网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
9、在javac及java命令行上使用-classpath (或-cp)选项可以引用别的库
参考答案和解析
编译
更多 “9、在javac及java命令行上使用-classpath (或-cp)选项可以引用别的库” 相关考题
考题
JDK环境变量都设置好了,在DOS中输入JAVA-VERSION也对 可怎么javac就提示不是内部或外部命令呢环境变量如下CLASSPATH=.\%JAVA_HOME%\libJAVA_HOME="C:\Program Files\Java\jdk1.6.0_02"Path=%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Common Files\TTKN\Bin;C:\Program Files\Rational\common
考题
下面关于path和classpath的说法中,错误的是()
A、path用来指定java虚拟机(JVM)所在的目录B、classpath用来指定我们自己所写的或要用到的类文件(.jar文件)所在的目录C、在dos命令行中,classpath和path环境变量的查看与配置的方式不相同D、只要设置了classpath这个环境变量系统就不会再在当前目录下查询某个类
考题
下面关于classpath的说法中,错误的是()。
A、classpath和path环境变量的查看与配置的方式完全相同。B、为了让Java虚拟机能找到所需的class文件,就需要对classpath环境变量进行设置。C、从JDK5.0开始,如果classpath环境变量没有进行设置,Java虚拟机会自动将其设置为“.”,也就是当前目录。D、在命令行窗口中配置了classpath后,重新打开新命令行窗口依然生效
考题
A developer is creating a class Book that needs to access class Paper.The Paper class is deployed in a JARnamedmyLib.jar.Whichthree,taken independently,will allow the developer to use the Paper class while compiling the Book class?()A、The JAR fileis located at$JAVA_HOME/jre/classes/myLib.jar.B、The JAR fileis located at$JAVA_HOME/jre/lib/ext/myLib.jar.C、TheJ AR fileis located at/foo/myLib.jar and aclasspath environment variable is set that includes /foo/myLib.jar/Paper.class.D、The JAR fileis located at/foo/myLib.jar and a classpath environment variable is set that includes/foo/myLib.jar.E、The JAR file is located at/foo/myLib.jar and the Book class is compiled using javac-cp/foo/myLib.jar/Paper Book.java.F、The JAR file is located at/foo/myLib.jar and the Book class is compiled using javac-classpath/foo/myLib.jar Book.java.
考题
假设在目录myprj/src/school中有Java源文件Student.java,如果希望该文件编译后的类文件出现在目录myprj/classes/school中,应该使用下列哪一个命令?() A、cd myprj/src javac –d ../classes school/Student.javaB、cd myprj/src javac ../classes school/*.javaC、cd myprj javac –d ../classes school/*.javaD、cd myprj/src/school javac –d ../classes school/Student.java
考题
下列关于classpath环境变量的说法中,哪一个是正确的()。A、classpath配置一次后可永久使用B、没有classpath环境变量就不能运行Java程序C、classpath环境变量可以让虚拟机找到class文件的目录D、查看当前classpath配置的命令是:classpath
考题
下面说法正确的是()A、Java程序的源文件名称与主类(puublic class)的名称相同,后缀可以是.java或.txt等B、JDK的编译命令是javaC、一个java源文件编译后可能产生多个class文件D、在命令行编译好的字节码文件,只需在命令行直接输入程序名即可运行该程序
考题
A class games.cards.Poker is correctly defined in the jar file Poker.jar. A user wants to execute the main method of Poker on a UNIX system using the command: java games.cards.Poker What allows the user to do this?()A、put Poker.jar in directory /stuff/java,and set the CLASSPATH to include /stuff/javaB、put Poker.jar in directory /stuff/java,and set the CLASSPATH to include /stuff/java/*.jarC、Put Poker.jar in directory /stuff/java,and set the CLASSPATH to include /stuff/java/Poker.jarD、put Poker.jar in directory /stuff/java/games/cards,and set the CLASSPATH to include /stuff/javaE、put Poker.jar in directory /stuff/java/games/cards,and set the CLASSPATH to include /stuff/java/*.jarF、put Poker.jar in directory /stuff/java/games/cards,and set the CLASSPATH to include /stuff/java/Poker.jar
考题
class java { public static void main(String [] java) { for (int Java = 1; Java 〈 java.length; Java++) System.out.print("java "); } } 和命令行: java java java java java 结果为:() A、javaB、java javaC、java java javaD、编译失败
考题
A developer is creating a class Book, that needs to access class Paper. The Paper class is deployed in a JAR named myLib.jar. Which three, taken independently, will allow the developer to use the Paper class while compiling the Bookclass?()A、The JAR file is located at $JAVA_HOME/jre/classes/myLib.jar.B、The JAR file is located at $JAVA_HOME/jre/lib/ext/myLib.jar..C、The JAR file is located at /foo/myLib.jar and a classpath environment variable is set that includes /foo/myLib.jar/Paper.class.D、The JAR file is located at /foo/myLib.jar and a classpath environment variable is set that includes /foo/myLib.jar.E、The JAR file is located at /foo/myLib.jar and the Book class is compiled using javac - cp /foo/myLib.jar/Paper Book.java.F、The JAR file is located at /foo/myLib.jar and the Book class is compiled using javac - classpath /foo/myLib.jar Book.java
考题
关于JavaBean正确的说法是()。A、Java文件与Bean所定义的类名可以不同,但一定要注意区分字母的大小写B、被引用的Bean文件的文件名后缀为.javaC、Bean文件放在任何目录下都可以被引用D、在JSP文件中引用Bean,其实就是用jsp:useBean语句
考题
单选题下面关于path和classpath的说法中,错误的是()。A
path用来指定java虚拟机(JVM)所在的目录B
classpath用来指定我们自己所写的或要用到的类文件(.jar文件)所在的目录C
在dos命令行中,classpath和path环境变量的查看与配置的方式不相同D
只要设置了classpath这个环境变量系统就不会再在当前目录下查询某个类
考题
多选题A developer is creating a class Book that needs to access class Paper.The Paper class is deployed in a JARnamedmyLib.jar.Whichthree,taken independently,will allow the developer to use the Paper class while compiling the Book class?()AThe JAR fileis located at$JAVA_HOME/jre/classes/myLib.jar.BThe JAR fileis located at$JAVA_HOME/jre/lib/ext/myLib.jar.CTheJ AR fileis located at/foo/myLib.jar and aclasspath environment variable is set that includes /foo/myLib.jar/Paper.class.DThe JAR fileis located at/foo/myLib.jar and a classpath environment variable is set that includes/foo/myLib.jar.EThe JAR file is located at/foo/myLib.jar and the Book class is compiled using javac-cp/foo/myLib.jar/Paper Book.java.FThe JAR file is located at/foo/myLib.jar and the Book class is compiled using javac-classpath/foo/myLib.jar Book.java.
考题
多选题A developer is creating a class Book, that needs to access class Paper. The Paper class is deployed in a JAR named myLib.jar. Which three, taken independently, will allow the developer to use the Paper class while compiling the Book class?()AThe JAR file is located at $JAVA_HOME/jre/classes/myLib.jar.BThe JAR file is located at $JAVA_HOME/jre/lib/ext/myLib.jar..CThe JAR file is located at /foo/myLib.jar and a classpath environment variable is set that includes /foo/myLib.jar/Paper.class.DThe JAR file is located at /foo/myLib.jar and a classpath environment variable is set that includes /foo/myLib.jar.EThe JAR file is located at /foo/myLib.jar and the Book class is compiled using javac -cp /foo/myLib.jar/Paper Book.java.FThe JAR file is located at /foo/myLib.jar and the Book class is compiled using javac -d /foo/myLib.jar Book.javaGThe JAR file is located at /foo/myLib.jar and the Book class is compiled using javac -classpath /foo/myLib.jar Book.java
考题
多选题A developer is creating a class Book, that needs to access class Paper. The Paper class is deployed in a JAR named myLib.jar. Which three, taken independently, will allow the developer to use the Paper class while compiling the Bookclass?()AThe JAR file is located at $JAVA_HOME/jre/classes/myLib.jar.BThe JAR file is located at $JAVA_HOME/jre/lib/ext/myLib.jar..CThe JAR file is located at /foo/myLib.jar and a classpath environment variable is set that includes /foo/myLib.jar/Paper.class.DThe JAR file is located at /foo/myLib.jar and a classpath environment variable is set that includes /foo/myLib.jar.EThe JAR file is located at /foo/myLib.jar and the Book class is compiled using javac - cp /foo/myLib.jar/Paper Book.java.FThe JAR file is located at /foo/myLib.jar and the Book class is compiled using javac - classpath /foo/myLib.jar Book.java
考题
多选题A developer is creating a class Book, that needs to access class Paper. The Paper class is deployed in a JAR named myLib.jar. Which three, taken independently, will allow the developer to use the Paper class while compiling the Book class?()AThe JAR file is located at $JAVA_HOME/jre/classes/myLib.jarBThe JAR file is located at $JAVA_HOME/jre/lib/ext/myLib.jarCThe JAR file is located at /foo/myLib.jar and a classpath environment variable is set that includes /foo/myLib.jar/Paper.classDThe JAR file is located at /foo/myLib.jar and a classpath environment variable is set that includes /foo/myLib.jarEThe JAR file is located at /foo/myLib.jar and the Book class is compiled using javac –cp /foo/myLib.jar/Paper Book.javaFThe JAR file is located at foo/myLib.jar and the Book class is compiled using javac –classpath /foo/myLib.jar Book.java
考题
单选题下面关于classpath的说法中,错误的是()。A
classpath和path环境变量的查看与配置的方式完全相同。B
为了让Java虚拟机能找到所需的class文件,就需要对classpath环境变量进行设置。C
从JDK5.0开始,如果classpath环境变量没有进行设置,Java虚拟机会自动将其设置为“.”,也就是当前目录。D
在命令行窗口中配置了classpath后,重新打开新命令行窗口依然生效
考题
单选题A class games.cards.Poker is correctly defined in the jar file Poker.jar. A user wants to execute the main method of Poker on a UNIX system using the command: java games.cards.Poker What allows the user to do this?()A
put Poker.jar in directory /stuff/java, and set the CLASSPATH to include /stuff/javaB
put Poker.jar in directory /stuff/java, and set the CLASSPATH to include /stuff/java/*.jarC
Put Poker.jar in directory /stuff/java, and set the CLASSPATH to include /stuff/java/Poker.jarD
put Poker.jar in directory /stuff/java/games/cards, and set the CLASSPATH to include /stuff/javaE
put Poker.jar in directory /stuff/java/games/cards, and set the CLASSPATH to include /stuffijava/*.jarF
put Poker.jar in directory /stuff/java/games/cards, and set the CLASSPATH to include /stuff/java/Poker.jar
考题
单选题下面说法正确的是()A
Java程序的源文件名称与主类(puublic class)的名称相同,后缀可以是.java或.txt等B
JDK的编译命令是javaC
一个java源文件编译后可能产生多个class文件D
在命令行编译好的字节码文件,只需在命令行直接输入程序名即可运行该程序
热门标签
最新试卷