Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Basic question

 
Suriya chandra
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 111
8
Clojure IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 106
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this.see()

-Pavan
 
Mohamed Sanaulla
Saloon Keeper
Posts: 3159
33
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Similar queries have been asked before on JavaRanch, so it might be helpful if you can also search for the related posts.
 
Karn Kumar
Ranch Hand
Posts: 153
Eclipse IDE Java Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For the JDK, JRE,JVM refer this link

http://www.coderanch.com/t/538022/java/java/JDK-JRE-JVM
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic