Professional Documents
Culture Documents
JLINK is java’s new command line tool through which we can create our own customised JRE.
usually, we run our program using default JRE which is provided by Oracle or JAVA people but
in case if you wants to create your own JRE than you can go with JLINK concept.
Why our own JRE –
I think you people have a question in your mind that – JAVA people provided the default JRE
and we can happily run our program using this default JRE then what is need of creating our
own JRE
so let’s take an example through which it will be clear that why we need to create customised
JRE and what is the problem with default JRE –
suppose we have a simple “hello world” program like –
class Test {
public static void main(String[]args) {
System.out.prinltn("Hello World") ;
}
If I want to run this small program on my system, I need to install a default JRE which is
provided by JAVA people. After installing default JRE I can happily run my small “hello world”
application.
Test.class
String.class
System.class
Object.class
Here 3 to 4 .class will be enough to run my application.
But the default JRE which is provided by Oracle contains 4300+ predefined java .class files.
If I will execute my “hello world” application with default JRE than all the predefine .class files
will be executed but I need only 3 to 4 .class files for executing my “hello world” application
then why I need to maintain another .class file.
So The problem with default JRE is – default JRE executes the all predefined .class file
whether you want or not
And if you will also look into default JRE size then it is 203 MB, and for executing my simple 1
kb of code, I have to maintain 203 sizes of JRE in our machine so it is completely wastage of
Memory.
So using default JRE means –
so this is all about JLINK, I hope now you people have a clear picture of JRE.