Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- try {
- ProcessBuilder pb =
- new ProcessBuilder("cmd.exe", "/C", "javap", "-verbose", "<path_to_class_file>");
- Map<String, String> env = pb.environment();
- env.put("Path", "C:\Program Files\Java\jdk-11.0.1\bin");
- Process p = pb.start();
- BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
- String line = "";
- while ((line = br.readLine()) != null) {
- System.out.println(line);
- }
- int exitValue = p.waitFor();
- System.out.println("nnExit Value is " + exitValue);
- } catch (InterruptedException | IOException e) {
- e.printStackTrace();
- }
- }
- Classfile /D:/HelloWorld.class
- Last modified 21-Feb-2019; size 425 bytes
- MD5 checksum 29fe59b7ca108f7691a1f144ccd37c90
- Compiled from "HelloWorld.java"
- public class HelloWorld
- minor version: 0
- major version: 55
- ...
- public HelloWorld();
- descriptor: ()V
- flags: (0x0001) ACC_PUBLIC
- Code:
- stack=1, locals=1, args_size=1
- 0: aload_0
- 1: invokespecial #1 // Method java/lang/Object."<init>":()V
- 4: return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement