This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes how to use jsr Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "how to use jsr" Watch "how to use jsr" New topic
Author

how to use jsr

Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 979
    
    2
i have a very basic question, so far i know what are jsr,
but i don't know how to use them?
i mean they came when i download java, i mean the java itself, or i need to download jsr's explicitly?
and how do i use them?
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

JSRs are Java Specification Requests. They are proposed new features for future versions of Java. Each JSR is being worked on by an expert group of people. Often they have an example implementation to explore how the proposed new feature would work.

By "using a JSR", do you mean using the proposed new API? If that's what you mean, you could download the example implementation of a JSR if there's one available, which most likely will consist of one or more JAR files, and use those JAR files like you would use any other Java library. Be aware though that you're most likely dealing with experimental and possibly incomplete code. I wouldn't use such experimental code for a real project that has to go into production for a customer.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 979
    
    2
okay so if something is proposed for java 8, that i can also use in java 7, but for that i need to download jar file for that jsr.
and if i download java8 so in that i do not need to download.
just like project coin is a new feature in java 7, so if i use java7, i do not need to download it's jar, but if i want to use it in java 6, i need to download that jar, right?
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

Yes, but just using a library will not allow you to use new language features (new syntax that isn't in the version of Java that you're using).

Also, note that most JSRs are work-in-progress; the API that you might find in a reference implementation might not be exactly how it's going to be in a future Java version.
Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 979
    
    2
Jesper de Jong wrote:Yes, but just using a library will not allow you to use new language features (new syntax that isn't in the version of Java that you're using).
Also, note that most JSRs are work-in-progress; the API that you might find in a reference implementation might not be exactly how it's going to be in a future Java version.


i am confused in this line, if it won't allow us to use new features that what it allow us?
do you want to say that it won't allow us to use all new features but some it allow?
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

If there is new syntax for the language, that your current Java compiler doesn't understand, then adding a JAR file to the classpath isn't going to make the Java compiler understand new syntax.
 
Consider Paul's rocket mass heater.
 
subject: how to use jsr
 
Similar Threads
Bluetooth Development
To Bert and Kathy: Materials used for SCJP Tiger
portlet.tld missing
Portlet Development
how to compile this type of code..