JAVAP is a tool that Sun provides to decompile a class file
1. Configure run---External tools---external tools configurations
Select Program New JAVAP run mode
Setting options for location, workspace, etc.
Such as:
It is important to note that workspace selection and argument configuration
Workding directory is set to ${workspace_loc}/${project_name},
Arguments:
-c-verbose-classpath ${workspace_loc}/${project_name}/bin ${java_type_name}
If setting the error will prompt cannot the Find XXX class error, or is about Java_type_name empty error
Arguments to add java_type_name, otherwise will prompt no classes were specified on the command line
2, run. Also click on the Javap Run button to select the. java file you want to run, so you can use JAVAP in eclipse.
The following is an explanation of the variables that set the working directory (working directory) and parameters (Arguments), which you can skip if you just want to know how to use JAVAP. Before setting these two options, we will first describe the variables on the right (Variables) so that we have an understanding of how Eclipse manages our project. We checked Variables.
A series of English words will appear, such as:
These English words are described below, if you do not want to continue to see the following content, you can try to translate the following variable description (Variables descriptions), I am lazy people English is not good, directly through the link to the eclipse of the Chinese, Albeit the content of someone else's translation directly, here is the explanation of its parameters:
1.${build_files}
Returns a collection of the absolute file system paths to which the modification caused the current build. You can add a series of characters (added), "C" for Change (changed), "R" for removal (removed), "F" for files only, and "D" for directories only (directories only) is provided as an argument so that the file list contains only a specific type of change. The default is to include the total amount of variance.
2.${build_project}
Returns a collection of the absolute file system paths to which the modification caused the current build. You can add a series of characters (added), "C" for Change (changed), "R" for removal (removed), "F" for files only, and "D" for directories only (directories only) is provided as an argument so that the file list contains only a specific type of change. The default is to include the total amount of variance.
3.${build_type}
Returns the type of build that is being executed: incremental, full, automatic, or none.
4.${container_loc}
Returns the absolute file system path of the container for the resource. When no argument is specified, the target resource is the selected resource, otherwise the target resource is the resource identified by the relative path of the workspace.
5.${container_name}
Returns the name of the container for the resource. When no argument is specified, the target resource is the selected resource, otherwise the target resource is the resource identified by the relative path of the workspace.
6.${container_path}
Returns the workspace relative path of the resource's container. When no argument is specified, the target resource is the selected resource, otherwise the target resource is the resource identified by the relative path of the workspace.
7.${current_date}
Returns the time of the current system in the format YYYYMMDD_HHMM. You can use optional declarations to specify other formats. The format must be a valid form of Java.util.SimpleDateFormat.
8.${eclipse_home}
Basic installation location of the running platform
9.${env_var}
Returns the value of an environment variable. The environment variable name must be specified as an independent variable.
10.${file_prompt}
Returns the absolute file system path of the file selected in the Select File dialog box. When providing an argument, use it as a hint on the caption of the dialog box. Use it as the initial value of the Select File dialog box when you provide a second argument. The first argument and the second argument must be separated by ":".
11.${folder_prompt}
Returns the absolute file system path of the directory selected in the Select Directory dialog box. When providing an argument, use it as a hint on the caption of the dialog box. Use it as the initial value of the Select Directory dialog box when you provide a second argument. The first argument and the second argument must be separated by ":".
12.${java_extensions_regex}
Regular expressions that match a registered Java-like file name extension
13.${java_type_name}
Returns the standard Java type name of the primary type in the selected resource.
14.${project_classpath}
Returns the system path for the project
15.${project_loc}
Returns the absolute file system path of the project for the resource. When no argument is specified, the target resource is the selected resource, otherwise the target resource is the resource identified by the relative path of the workspace.
${project_name}
Returns the name of the project for the resource. When no argument is specified, the target resource is the selected resource, otherwise the target resource is the resource identified by the relative path of the workspace.
17.${project_path}
Returns the workspace relative path of the resource's project. When no argument is specified, the target resource is the selected resource, otherwise the target resource is the resource identified by the relative path of the workspace.
18.${resource_loc}
Returns the absolute file system path of the resource. When no argument is specified, the target resource is the selected resource, otherwise the target resource is the resource identified by the relative path of the workspace.
19.${resource_name}
Returns the name of the resource. When no argument is specified, the target resource is the selected resource, otherwise the target resource is the resource identified by the relative path of the workspace.
${resource_path}
Returns the relative path of the resource's workspace. When no argument is specified, the target resource is the selected resource, otherwise the target resource is the resource identified by the relative path of the workspace.
21.${selected_resource_loc}
Returns the file system absolute path of the selected resource's workspace
${selected_resource_name}
Returns the name of the selected resource
. ${selected_resource_path}
Returns the relative path of the selected resource's workspace
${selected_text}
Returns the currently selected text in the active editor.
26.${system}
Returns the value of the ECLIPSE system variable. The variable name must be specified as an argument-one of the following values: ARCH, Eclipse_home, NL, OS, or WS.
${system_path}
Returns an absolute file system path to an external file. Resolves by locating the first specified tool that appears based on the specified system path. The tool name must be supplied as an argument.
28.${system_property}
Returns the value of the system property from the Eclipse runtime. The system property name must be specified as an argument.
${workspace_loc}
Returns the absolute file system path of the workspace root. When an argument is specified, the absolute file system path of the resource identified by the relative path of the workspace is returned.
The above is basically all variable descriptions (Variables descriptions), please note that the option labeled green is the Variables we need to use.
We have explained the need to configure 2 places, the first is the working directory, that is, we created the project directory, you can use ${workspace_loc}/${project_name} to express,
In the case of the path delimiter, you can choose ' \ ' can also select '/', both are possible. The second setting is our parameter setting, which is the class file that we need to JAVAP decompose, which can take advantage of ${workspace_loc}/${project_name}/bin /${java_type_name}, note that we have to add a bin directory in the middle, because eclipse will compile our Java files into this directory, but in Variables there are no variables representing that directory, so it can only be added manually.
If you are configuring for the first time, it is best to read the instructions below, perhaps the following error occurs during the first run:
Then please be sure to choose the Java file you want to JAVAP when running JAVAP, meaning that the Java file you want to break down must be selected, such as:
Then click on Run JAVAP, you will see the following decomposition of the class file:
Use JAVAP to run configuration details in eclipse