9、在javac及java命令行上使用-classpath (或-cp)选项可以引用别的库

9、在javac及java命令行上使用-classpath (或-cp)选项可以引用别的库


参考答案和解析
编译

相关考题:

在JAVA编程中,以下()命令用来执行java类文件。A.javacB.javaC.applet viewerD.以上所有选项都不正确

在具体运行Java程序的过程中,是使用JDK提供的()对java文件进行编译。 A.java.exeB.虚拟机C.A和DD.javac.exe

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后,重新打开新命令行窗口依然生效

若希望命令行窗口下,在任意路径中都可以使用java命令,那么应该()A、设置classpath环境变量B、设置path环境变量C、设置name环境变量

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

在JAVA编程中,源代码文件的扩展名为()。A、.classB、.javaC、.comD、以上所有选项都不正确

在JAVA编程中,以下()命令用来执行java类文件。A、javacB、javaC、appletviewerD、以上所有选项都不正确

执行一个applet,可以使用()A、java.exeB、appletviewer.exeC、Javac.exeD、javadocument.exe

在JAVA编程中,以下()命令能够将Java源文件转换为类文件。A、appletviewerB、javaC、javacD、以上所有选项都不正确

下列关于classpath环境变量的说法中,哪一个是正确的()。A、classpath配置一次后可永久使用B、没有classpath环境变量就不能运行Java程序C、classpath环境变量可以让虚拟机找到class文件的目录D、查看当前classpath配置的命令是:classpath

下面说法正确的是()A、Java程序的源文件名称与主类(puublic class)的名称相同,后缀可以是.java或.txt等B、JDK的编译命令是javaC、一个java源文件编译后可能产生多个class文件D、在命令行编译好的字节码文件,只需在命令行直接输入程序名即可运行该程序

简述Java中path及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 /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的说法中,错误的是()。Apath用来指定java虚拟机(JVM)所在的目录Bclasspath用来指定我们自己所写的或要用到的类文件(.jar文件)所在的目录C在dos命令行中,classpath和path环境变量的查看与配置的方式不相同D只要设置了classpath这个环境变量系统就不会再在当前目录下查询某个类

单选题给定一个Java源程序Test.Java,在命令行中应该使用下面()语句可以编译、运行该程序。A AB BC CD D

多选题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的说法中,错误的是()。Aclasspath和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

单选题下面说法正确的是()AJava程序的源文件名称与主类(puublic class)的名称相同,后缀可以是.java或.txt等BJDK的编译命令是javaC一个java源文件编译后可能产生多个class文件D在命令行编译好的字节码文件,只需在命令行直接输入程序名即可运行该程序