JDK and JRE, what is what?

View previous topic View next topic Go down

Java JDK and JRE, what is what?

Post by BIT0102-Mohaimin on Sun Dec 05, 2010 1:41 pm

Many of you may be in confusion about difference between JDK and JRE. This topics aims to clarify the confusion, including a reliable link for more information.

JRE is Java Runtime Environment. To run a Java application of any type, you need JRE. JRE provides the Java Virtual Machine (JVM)

JDK is Java Development Kit. It provides you the Java compiler and some other facilities for development. To generate an executable program from source, you will need JDK.

If you are a developer, you need JDK, if you are just a user, you only need JRE.

Note that, JDK must have one or more JREs embedded inside. So, if you have JDK, you do not need to install JRE separately.

For more information, visit the Oracle site.
JGuru site also help me write this topic.


Last edited by BIT0102-Mohaimin on Sun Dec 05, 2010 5:42 pm; edited 1 time in total (Reason for editing : Missed the second (JGuru) link)
avatar
BIT0102-Mohaimin
Programmer
Programmer

Course(s) :
  • BIT

Blood Group : B+
Posts : 415
Points : 715

View user profile

Back to top Go down

Java Re: JDK and JRE, what is what?

Post by BIT0122-Amit on Sun Dec 05, 2010 2:58 pm

I am slightly confused about two things.

1) in what case does JDK contain multiple JREs?

2) This is my personal experience. When I first started using ubuntu, I noticed that without any jdk/jre installed, I can run eclipse, compile and execute codes simply by putting a jre for linux under eclipse directory. I am still confused, how I was able to compile this codes. Is there any possible explanation from you?

Nevertheless, rep++

_________________________________________________________________
Adminship / Moderatorship is not about power, it is about Responsibility.

|About me|My Blog|
avatar
BIT0122-Amit
Founder
Founder

Course(s) :
  • BIT

Blood Group : O+
Posts : 4187
Points : 6605

View user profile http://iitdu.forumsmotion.com

Back to top Go down

Java Re: JDK and JRE, what is what?

Post by BIT0130-Shakkhor on Sun Dec 05, 2010 5:27 pm

BIT0122-Amit wrote:1) in what case does JDK contain multiple JREs?
I think what he meant is that the JRE is a prerequisite for JDK. So JDK must have at least one JRE embedded inside. The JDK package itself however, contains only one JRE.
Disclaimer: This is just a hypothesis lol!

_________________________________________________________________
I'm not a driver with drinking problem.
I'm an alcoholic with driving problem.

Blog | বাংলা ব্লগ
avatar
BIT0130-Shakkhor
Programmer
Programmer

Course(s) :
  • BIT

Blood Group : B+
Posts : 209
Points : 328

View user profile

Back to top Go down

Java Re: JDK and JRE, what is what?

Post by BIT0102-Mohaimin on Sun Dec 05, 2010 5:39 pm

1) in what case does JDK contain multiple JREs?
I found this from here. http://www.jguru.com/faq/view.jsp?EID=46223
I think Shakkhor's hypotheses is right. I am not sure. I am adding this link in the title post.


2) This is my personal experience. When I first started using ubuntu, I noticed that without any jdk/jre installed, I can run eclipse, compile and execute codes simply by putting a jre for linux under eclipse directory. I am still confused, how I was able to compile this codes. Is there any possible explanation from you?
I dont know what happened. I think default JDK may have played some roles here. Did you try commands javac or java form command line?
avatar
BIT0102-Mohaimin
Programmer
Programmer

Course(s) :
  • BIT

Blood Group : B+
Posts : 415
Points : 715

View user profile

Back to top Go down

Java Re: JDK and JRE, what is what?

Post by BIT0122-Amit on Sun Dec 05, 2010 6:11 pm

Code:
I dont know what happened. I think default JDK may have played some roles here. Did you try commands javac or java form command line?

When we try javac or java from command line, it searches in the present working directory first, and then it searches through the path variable(or vice versa).

And I have already stated that it was a fresh ubuntu installation, it didn't have jdk, or jre.

The actual scenario was this.
I installed ubuntu. Extracted eclipse.tried to execute it, it said it can not find jre in eclipse directory, I downloaded and extracted the jre archive file, renamed and made it jre folder and moved it to eclipse directory.

And eclipse started working, along with compiling and other things. the whole procedure was described here
http://iitdu.forumsmotion.com/ubuntu-f12/installing-eclipse-and-jre-in-ubuntu-offline-t380.htm

As you can see, it is a pretty old topic, and I didn't know how to setup jdk(both manually and from internet).

Thanks for the source, the link says each jdk contains one(or more) jre.

I am still confused about this confused

_________________________________________________________________
Adminship / Moderatorship is not about power, it is about Responsibility.

|About me|My Blog|
avatar
BIT0122-Amit
Founder
Founder

Course(s) :
  • BIT

Blood Group : O+
Posts : 4187
Points : 6605

View user profile http://iitdu.forumsmotion.com

Back to top Go down

Java Re: JDK and JRE, what is what?

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum