5

I am preparing core java and i got following doubt

javap is dis-assembler or de-compiler? what is the difference between them? which java CLI commands are used ?

5
  • possible duplicate of Is Java a Compiled or an interpreted programming language? Commented Jul 8, 2014 at 2:41
  • 4
    @sphanley not the same thing, the question you mention is whether Java is interpreted or compiled, here the question is about the utility javap Commented Jul 8, 2014 at 2:46
  • Side note: Oracle states here that "The javap command disassembles one or more class files." I'm not sure if they're following "technical" terminology, but it at least seems to match morgano's answer. Commented Jul 8, 2014 at 5:32
  • The javap command disassembles one or more class files and shows the byte code information. where as, Decompiling is something which converts these byte codes into java source code. Commented Jul 8, 2014 at 6:01
  • @morgano fair enough, I'm not familiar with javap so I assumed that it was a typo and this was just someone asking in poor english whether Java would be disassemlbled or decompiled. Commented Jul 8, 2014 at 13:04

1 Answer 1

9

Javap is just an "informal" dis-assembler, its output gives you information about the bytecode, but is not suitable for it to be used by an "assembler", it is rather for it to be read by a human.

The traditional difference (from the C language world):

  • Compiler: compiles a relatively high-level source code to assembly language
  • Assembler: compiles assembly code to machine code

take your conclusions for "de-compiler" and "dis-assembler"

Sometimes a software that does both steps (disassemble and decompile) is also called a decompiler, but it still depends on the context

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.