Skip to content
zhoumingjun edited this page Jun 3, 2019 · 2 revisions

Overview

References

https://docs.oracle.com/javase/8/docs/

Common

  • Why java is cross-platform

Linux: ELF

> file /usr/bin/kubectl        
/usr/bin/kubectl: ELF 64-bit LSB executable

MacOS: Mach-O

> file /usr/local/bin/kubectl
/usr/local/bin/kubectl: Mach-O 64-bit executable x86_64

Lifecycle

compile -> class loading -> runtime

Compile

  • how to compile .java files
    javac

  • how to co mpile .java files if there are 3rd depnendencies
    javac -cp

  • how to view the bytecode
    javap

ClassLoader

  • how to define class loader
    Class loadClass(String name)
    Class findClass(String name)
    Class defineClass(byte[] code, String name)

  • loading linking initializating
    J2SE doc
    JVM architecture

class loading

  • java class initialization sequenct
    parent static field/code block (only once)
    static field/code block (only once )
    parent field/code block
    parent constructor
    field/code block
    constructor

Runtime

  • jvm components heap
    vm stack
    native method stack
    Method area
    class information
    bytecode of methods and constructors
    runtime constant pool
    pc

jvm architecture

  • how to monitor jvm
    jstat visualvm ...

Test

JUnit

<<AllPages()>>

Clone this wiki locally