• 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
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

byte code compatibility with 6 ?

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it possible to use JDK7's features (say Coin) and yet compile for JDK6 ?
 
Marshal
Posts: 76852
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don’t know. Is Coin available in Java6? Can you add it to your classpath as a .jar?
 
Campbell Ritchie
Marshal
Posts: 76852
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It might say in the book we are offering how to add features to the classpath for older versions of Java™.
 
Jan Goyvaerts
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is Coin provided as a library in JDK7 ?

I'd rather expect the language changes to be a matter of byte code.
 
author
Posts: 84
5
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Java 7 features (COIN) are not available in Java 6. If you want to use the COIN features you have to use Java 7.
 
Jan Goyvaerts
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Richard Reese wrote:Java 7 features (COIN) are not available in Java 6. If you want to use the COIN features you have to use Java 7.



I mean of course to write source code with JDK7 - but - to compile it for version 6. The JDK6 JVM's are only used for runtime. As such the developers benefit from JDK7's features and the users don't need to upgrade to JDK7 yet.

Would that work ?
 
Ranch Hand
Posts: 258
2
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jan Goyvaerts wrote:

Richard Reese wrote:Java 7 features (COIN) are not available in Java 6. If you want to use the COIN features you have to use Java 7.



I mean of course to write source code with JDK7 - but - to compile it for version 6. The JDK6 JVM's are only used for runtime. As such the developers benefit from JDK7's features and the users don't need to upgrade to JDK7 yet.

Would that work ?


If you use some new features in Java7 but run on JVM6, that would fail. (e.g. Fork/Join)
Because these new features require library which available in Java7+

But if you are using new syntax in Java7, that should be fine. (I have not tried)
(i.e. Improved literal, Diamond Operator, String in Switch)
http://www.java-n-me.com/2012/01/java-7-project-coin-decompiled-part-ii.html
 
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
No, you cannot use Project Coin features and compile byte code that is compatible with Java 6.

Project Coin is a set of small changes to the Java programming language itself. It's not available as a library - these are changes to the programming language itself. You can't put that in a library.

If you compile with the -target 1.6 switch in Java 7, it will not allow you to use the new Project Coin language features.
 
Hey! Wanna see my flashlight? It looks like this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic