JDK(Java Development Kit)又称J2SDK(Java2 Software Development Kit),是Java开发工具包,它提供了Java的开发环境(提供了编译器javac等工具,用于将java文件编译为class文件)和运行环境(提 供了JVM和Runtime辅助包,用于解析class文件使其得到运行)。如果你下载并安装了JDK,那么你不仅可以开发Java程序,也同时拥有了运 行Java程序的平台。JDK是整个Java的核心,包括了Java运行环境(JRE),一堆Java工具tools.jar和Java标准类库 (rt.jar)。
Software Developers: JDK (Java SE Development Kit). For Java Developers. Includes a complete JRE plus tools for developing, debugging, and monitoring Java applications. Administrators running applications on a server: Server JRE (Server Java Runtime Environment) For deploying Java applications on servers. Includes tools for JVM monitoring and tools commonly required for server applications, but does not include browser integration (the Java plug-in), auto-update, nor an installer. Learn more End user running Java on a desktop: JRE: (Java Runtime Environment). Covers most end-users needs. Contains everything required to run Java applications on your system.
功能说明:C 头文件和 Stub 文件生成器;javah 从 Java 类生成 C 头文件和 C 源文件;这些文件提供了连接胶合,使 Java 和 C 代码可进行交互
语法:javah [ 命令选项 ] fully-qualified-classname. . .
javah_g [ 命令选项 ] fully-qualified-classname. . .
查看程序javap.exe 程序 javap.exe的功能是查看知道类文件中的所有声明——类名、构建器和方法名、字段(变量)。最简单的用法是javap <类文件名> 执行后显示类文件中的包和类的所有声明,但不包含方法体。不带选项的命令不显示用private修饰的声明。javap命令的一般格式为:javap [选项] <类文件名>〈CR> 文件名中不能加扩展名。可能的选项及其意义如下。 -b Backward compatibility with javap in JDK 1.1 -c Disassemble the code -classpath Specify where to find user class files -extdirs Override location of installed extensions -help Print this usage message -J Pass directly to the runtime system -l Print line number and local variable tables -public Show only public classes and members -protected Show protected/public classes and members -package Show package/protected/public classes and members (default) -private Show all classes and members -s Print internal type signatures(签名) -bootclasspath Override location of class files loaded by the bootstrap class loader -verbose Print stack size, number of locals and args for met hods If verifying, print reasons for failure 选项-package是默认的,它显示package/protected/public的类,不显示private的,用-private选项可显示所有的。
例1 对第15章的例6使用下列命令 C:/javacode/zcb/ch15>javap FileDownload 输出结果如下: Compiled from FileDownload.java public class FileDownload extends javax.swing.JFrame implements java.awt.event.A ctionListener { java.lang.String url; javax.swing.JTextField tUrl; MyPanel mp; javax.swing.JButton bt; public FileDownload(); public void actionPerformed(java.awt.event.ActionEvent); static void getDown(java.lang.String); public static void main(java.lang.String[]); }javap FileDownload 上述命令这显示public类,不显示处在同一文件中的非public类。如果要求一起查看,可在命令行中加入多个文件名。如:javap FileDownload MyPanel
where is the name of a file containing IDL definitions, and [options] is any combination of the options listed below. The options are optional and may appear in any order; is required and must appear last.
Options: -d This is equivalent to the following line in an IDL #define -emitAll Emit all types, including those found in #included files. -f Define what bindings to emit. is one of client, server, all, serverTIE, allTIE. serverTIE and allTIE cause delegate model skeletons to be emitted. If this flag is not used, -fclient is assumed. -i By default, the current directory is scanned for included files. This option adds another directory. -keep If a file to be generated already exists, do not overwrite it. By default it is overwritten. -noWarn Suppress warnings. -oldImplBase Generate skeletons compatible with old (pre-1.4) JDK ORBs. -pkgPrefix When the type or module name is encountered at file scope, begin the Java package name for all files generated for with . -pkgTranslate When the type or module name in encountered, replace it with in the generated java package. Note that pkgPrefix changes are made first. must match the full package name exactly. Also, must not be org, org.omg, or any subpackage of org.omg. -skeletonName Name the skeleton according to the pattern. The defaults are: %POA for the POA base class (-fserver or -fall) _%ImplBase for the oldImplBase base class (-oldImplBase and (-fserver or -fall)). -td use for the output directory instead of the current directory. -tieName Name the tie according to the pattern. The defaults are: %POATie for the POA tie (-fserverTie or -fallTie) %_Tie for the oldImplBase tie (-oldImplBase and (-fserverTie or -fallTie)). -v, -verbose Verbose mode. -version Display the version number and quit.
where options include: -help print out this message and exit -sourcepath directories in which to look for source files -attach attach to a running VM at the specified address using standard connector -listen wait for a running VM to connect at the specified address using standard connector -listenany wait for a running VM to connect at any available address using standard connector -launch launch VM immediately instead of waiting for 'run' command -connect :=,... connect to target VM using named connector with listed argument values -dbgtrace [flags] print info for debugging jdb -tclient run the application in the Hotspot(tm) Performance Engine (Client) -tserver run the application in the Hotspot(tm) Performance Engine (Server)
options forwarded to debuggee process: -v -verbose[:class|gc|jni] turn on verbose mode -D= set a system property -classpath list directories in which to look for classes -X
is the name of the class to begin debugging are the arguments passed to the main() method of
For command help type 'help' at jdb prompt
java.exe可用的选项及其意义如下: -cp -classpath set search path for application classes and resources -D= set a system property -verbose[:class|gc|jni] enable verbose output -version print product version and exit -showversion print product version and continue -? -help print this help message -X print help on non-standard options
where options include: -b Backward compatibility with javap in JDK 1.1 -c Disassemble the code -classpath Specify where to find user class files -extdirs Override location of installed extensions -help Print this usage message -J Pass directly to the runtime system -l Print line number and local variable tables -public Show only public classes and members -protected Show protected/public classes and members -package Show package/protected/public classes and members (default) -private Show all classes and members -s Print internal type signatures -bootclasspath Override location of class files loaded by the bootstrap class loader -verbose Print stack size, number of locals and args for methods If verifying, print reasons for failure
Shell 流程控制
和Java、PHP等语言不一样,sh的流程控制不可为空,如(以下为PHP流程控制写法):
<?php
if(isset($_GET["q"])){
search(q);}else{// 不做任何事情}
在sh/bash里可不能这么写,如果else分支没有语句执行,就不要写这个else,就像这样 if else if
if 语句语
因为我们做的是聊天室,所以会有多个客户端,每个客户端我们用一个线程去实现,通过搭建一个服务器来实现从每个客户端来读取信息和发送信息。
我们先写客户端的线程。
public class ChatSocket extends Thread{
Socket socket;
public ChatSocket(Socket socket){
this.sock
在第一篇中,定义范型类时,使用如下的方式:
public class Generics<M, S, N> {
//M,S,N是范型参数
}
这种方式定义的范型类有两个基本的问题:
1. 范型参数定义的实例字段,如private M m = null;由于M的类型在运行时才能确定,那么我们在类的方法中,无法使用m,这跟定义pri
当tomcat是解压的时候,用eclipse启动正常,点击startup.bat的时候启动报错;
报错如下:
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME shou
When you got error message like "Property null not found ***", try to fix it by the following way:
1)if you are using AdvancedDatagrid, make sure you only update the data in the data prov
当iOS 8.0和OS X v10.10发布后,一个全新的概念出现在我们眼前,那就是应用扩展。顾名思义,应用扩展允许开发者扩展应用的自定义功能和内容,能够让用户在使用其他app时使用该项功能。你可以开发一个应用扩展来执行某些特定的任务,用户使用该扩展后就可以在多个上下文环境中执行该任务。比如说,你提供了一个能让用户把内容分
SQL>select text from all_source where owner=user and name=upper('&plsql_name');
SQL>select * from user_ind_columns where index_name=upper('&index_name'); 将表记录恢复到指定时间段以前