• 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

Java Extensions

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ranchers,
Can anyone please tell me "What are extensions?".
I know these are packages with lot of useful classes..
Does all extensions start with Javax.*****.* ?
If not how do i know which are under standard and which are under extension libraries?
 
Ranch Hand
Posts: 624
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Java extensions are not anything special really. They are just other classes in the JDK. When Java was first developed (back in the version 1.0 days) all the standard classes were put in java.abcd packages. They also included "non-standard" classes and packages at "extensions" in the extension packages of javax.abcd. These extension classes were classes that Sun considered non-core (for the lack of a better description). The original plan was that at some point in the process of the JDK development and improvement that as extension classes matured, they could/would get moved into the standard (or core) classes by being change to java.abcd packages. So javax.somePackage would become java.somePackage. However, it was realized that doing such would break existing programs and code and thus prevent them from being forward compatible. So if my program written for Java 1.0.2 used/imported javax.somePackage.SomeClass, if the package was moved and became java.somePackage.SomeClass in JDK 1.2, my program would not be compatible using 1.2 or later. Therefore, in the end, Sun did not employ this strategy and javax.abcd packages stayed javax.abcd packages.
Today extensions packages are simply other packages in the JDK. You really do not need to worry about them in any other way or try & determine what the differences are. Essentially, it is just a historical naming convention that has no significant meaning today. The only real significance is you need to remember if a package is part of java.* or javax.*
[ February 14, 2004: Message edited by: Mark Vender ]
 
Mark Vedder
Ranch Hand
Posts: 624
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
By the way, be sure not to confuse the extension classes with "The Extension Mechanism" of the Java Platform. You can read about that at The Extension Mechanism lesson at Sun's online Java Tutorial.
 
Rama Krishna Yalamanchili
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Mark for the Tutorial on Extensions.
Just to be more sure of this usage.
Can i put the j2ee.jar file in the extension library
$Home/user/jdk1.4/jre/lib/ext.
Can i compile my servlets if i put it in this library.
:roll:
As far as i can visualize from the documentation these extensions classes are seen by the JVM at run time.
Is it also allowed to put in my extension classes that i need to compile a j2ee web document in this library?
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can i compile my servlets if i put it in this library.
You could. I prefer to include it in my classpath when it's needed.
Is it also allowed to put in my extension classes that i need to compile a j2ee web document in this library?
You could, but the normal and recommended practice is to not place third party libraries in the ext directory - it should be saved for official Java extension APIs.
Again, I prefer to reference needed libraries (that are not part of J2SE) in my classpath at compile time.
 
reply
    Bookmark Topic Watch Topic
  • New Topic