• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JRE and exception example

 
Ranch Hand
Posts: 63
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We've all read the definition of the JRE:
"The Java Runtime Environment (JRE) provides the libraries, Java virtual machine, and other components necessary to run applets and applications written in the Java programming language".

Yet I never see examples of the 'libraries' immediately following this definition and never felt comfortable about what is meant by a runtime exception. I assume that they mean something illegal has happened to a runtime library when a program was running. But doesn't that always happen when a program fails?

So if anyone could provide a real simple example of a runtime library [aren't all libraries used at 'runtime' ?] and how an exception happens to it I'd be most appreciative. Also, do exceptions happen to libraries I create or only the ones provided by SUN?

Thanks in advance to all replies.

Danny
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have a look at the lib directory in your JDK or JRE installation directory. You will see a number of JAR files and DLL's (or other native shared library files depending on your operating system) there. Those are the libraries that is talked about in the statement. All the classes in the standard Java API (everything in all packages named java.* and more) are in the file rt.jar, which is one of the libraries.

Exceptions happen when a line of code throws one with the "throw" statement, for example:

Look at this part of The Java Tutorial for in-depth information about exceptions: The Java Tutorial - Lession: Exceptions
 
reply
    Bookmark Topic Watch Topic
  • New Topic