wood burning stoves 2.0
The moose likes Beginning Java and the fly likes Java Basic question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java Basic question" Watch "Java Basic question" New topic

Java Basic question

Suriya chandra

Joined: Apr 30, 2011
Posts: 14
I wanted to know what are JDK and JRE in layman terms...how are they of use for programming...it will be very helpful if you explain with some practical example...also please provide some info about setting variables(like class path variable) while installing java...why we need to set these variables in environment variables...how java goes to this environment variables?
Jason Bullers
Ranch Hand

Joined: Dec 27, 2011
Posts: 91

Hmm, okay. I'll give it a go and get the ball rolling on this one.

Basically, the JDK (Java Development Kit) is what you need for software development. It contains all the libraries, the compiler, and probably a bunch of other stuff that I've never had to work with and so am not familiar with. It also contains everything you need to run the programs you write. Running programs is the job of the JVM (the Java Virtual Machine). The JVM is also packaged with the JRE (Java Runtime Environment). Anyone who just wants to run java applications but doesn't care about writing them just needs the JRE.

I'm not sure exactly what you mean by the second part of the question, but the classpath is what java uses to find your classes and resources in order to load everything needed to run your application. You generally specify the classpath as an argument to the 'java' command used to run the program (-cp). If I remember right, there is also a CLASSPATH environment variable you can set to do the same thing. This might explain a bit better.
Pavan Kumar Dittakavi
Ranch Hand

Joined: Feb 12, 2011
Posts: 105


Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3152

Similar queries have been asked before on JavaRanch, so it might be helpful if you can also search for the related posts.

Mohamed Sanaulla | My Blog
Karn Kumar
Ranch Hand

Joined: Aug 06, 2009
Posts: 153

For the JDK, JRE,JVM refer this link

I agree. Here's the link: http://aspose.com/file-tools
subject: Java Basic question
It's not a secret anymore!