JDK 5 generated bytecode on older JREs

I am using enhanced 'for' loops that come with JDK5. Also, I will be using the new synchronization primitives and various other very JDK5-specific features.
Would like to know if can safely drop a JDK 5 generated .jar/.class into a 1.4 JRE. I'm expecting that these new language features wouldn't have necessitated new JVM instructions, and so can be run on JRE 1.4 as well.
Some Developer.

in JVM stands for (virtual) machine. Intuitively, I
thought, the enhanced for loop is just a syntactic
sugar for the developers, so would not require
changes in the JVM instruction set.For iterating over Collections, the enhanced for loop generates calls to a new 1.5-only API. Tough.
Google around (or search the forums) for compiling 1.5 for loops to 1.4 VMs. People have written bridge products to help with this.
Needless to say, I'm surprised and also somewhat
disappointed with Java (and with my understanding of it). Well, clearly the problem is with your understanding of it.
Just because it's a virtual machine, doesn't mean that code generated today will run on VMs written a year or 10 years ago. That would imply that once you lay down a API in the runtime, you are never ever allowed to change it, or add to it, for the infinite future..

Similar Messages

  • J2SE 1.4 generated classes on older JRE versions

    Maybe a newbie topic but is it normal that JDK 1.4 generated classes only work on the JRE 1.4 runtime environment ?
    If so, how do I compile to work on older runtime environments ?
    A link to a page with info on this would be most appreciated...

    Thanks,
    That was the link I was looking for.
    FYI : To make my applet run with the default JVM for Internet Explorer I had to compile to target 1.1 and strip the code from all Java 2 code. Strange, as I have IE 6.0 and you would expect it to come with a Java 2 runtime...
    Anyway, my first applet is on the Net now : http://www.ebo.bewoner.antwerpen.be/Shift/Game.html .
    I wonder if it works from other clients than mine...and especially other machines that a Windows PC !

  • Cross browser and platform including *support for clients with older jre"

    Hi there,
    I try to make applet to load and it's methods are to be executed from JavaScript.
    Current i have solve the part where the applet can be load onto the browser regradless of the browser or the platform. This was solved using the html converter provided by the jdk2 1.4.2 .
    However, i can't find a fact or prove so far that the html code will allow clients with older jre than 1.4.2 to load the applet. But i did try to use a older jdk to access the applet. And fine it did ask me to install a newer version of the jdk.
    I used the html converter from jdk 1.3 and use a browser with a high jdk, the end result was the applet wasn't loaded. Furthermore it asked to install the jdk 1.3
    The big question : Is there any way ... of making html code that allows all clients from various browser and platform to run the applet provided that their jdk is equal or higher that jdk 1.2 ? AT the same time, it will not prompt the client to install the jdk 1.2 if he/she has a higher jdk

    Hi there,
    I try to make applet to load and it's methods are to be executed from JavaScript.
    Current i have solve the part where the applet can be load onto the browser regradless of the browser or the platform. This was solved using the html converter provided by the jdk2 1.4.2 .
    However, i can't find a fact or prove so far that the html code will allow clients with older jre than 1.4.2 to load the applet. But i did try to use a older jdk to access the applet. And fine it did ask me to install a newer version of the jdk.
    I used the html converter from jdk 1.3 and use a browser with a high jdk, the end result was the applet wasn't loaded. Furthermore it asked to install the jdk 1.3
    The big question : Is there any way ... of making html code that allows all clients from various browser and platform to run the applet provided that their jdk is equal or higher that jdk 1.2 ? AT the same time, it will not prompt the client to install the jdk 1.2 if he/she has a higher jdk

  • How to launch a Java WebStart application with older JREs when Java 7u25 is on the client?

    How can I launch older versions of my Java WebStart application, that are built and run with Java 7u21 or earlier, even if Java 7u25 is installed locally on the client? Application launch and behaviour must be reliable and consistent.
    Background:
    As of 7u25 (and later), Java Webstart applications launch with a different class loader than pre-7u25.
    My Java Webstart application has supported versions that were built with older versions of the JDK (e.g. Java 5, 6, 7u21 or earlier). These applications run with their required JRE version, enforced through JNLP. Once Java 7u25 is installed locally, these older applications fail to launch, due to classloader differences.
    The question is: what is required to run older Java WebStart applications even if 7u25 (or later) Java Webstart is installed locally on the client?

    I confirm your findings when using shortcuts to try specific versions of JavaWS with 7u25 or later installed:
    JRE 5u14 launched and the classloader was as pre 7u25
    JRE 6u43 would not launch
    JRE 7u21 launched but the classloader was not as pre 7u25
    You can launch the shortcut with the JavaWS -verbose option to display a messagebox with valuable information.
    I am keeping a close watch on this thread.

  • It's possible change WSAD 5.1.2 java version[jdk 1.4.1],i woudl jre 5.0??

    hi
    i have a big problem,i would use tiger'jre but isn't possible,because also i change in Window->Preferences->Java-> Installed JREs in jdk 1.5,
    when i start the server(i use for jsf) ,this is report:
    ************ Start Display Current Environment ************
    WebSphere Platform 5.1 [BASE 5.1.0.3 cf30412.02] [JDK 1.4.1 b0344.02] running with process name localhost\localhost\server1 and process id 2320
    Host Operating System is Windows XP, version 5.1
    Java version = J2RE 1.4.1 IBM Windows 32 build cn1411-20031011 (JIT enabled: jitc), Java Compiler = jitc, Java VM name = Classic VM
    was.install.root = d:\Programmi\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51
    user.install.root = d:\Programmi\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51
    Java Home = d:\Programmi\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51\java\jre
    ws.ext.dirs = d:\Programmi\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/java/lib;d:\Programmi\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/classes;d:\Programmi\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/classes;d:\Programmi\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/lib;d:\Programmi\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/lib/ext;d:\Programmi\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/web/help;d:\Programmi\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/deploytool/itp/plugins/com.ibm.etools.ejbdeploy/runtime;H:\Documents and Settings\Administrator\Desktop\sorgenti JDavide\repository5\progetti\JDAvide\driverDB\sapdbc.jar;H:\Documents and Settings\Administrator\Desktop\sorgenti JDavide\JVolaSms-20040413.jar;H:/Programmi/IBM/SQLLIB/java/db2java.zip;d:/Programmi/IBM/WebSphere Studio/Application Developer/v5.1.2/wstools/eclipse/plugins/com.ibm.etools.webservice_5.1.2.3/runtime/worf.jar
    Classpath = d:\Programmi\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/properties;d:\Programmi\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/properties;d:\Programmi\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/lib/bootstrap.jar;d:\Programmi\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/lib/j2ee.jar;d:\Programmi\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/lib/lmproxy.jar;d:\Programmi\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/lib/urlprotocols.jar;d:/Programmi/IBM/WebSphere Studio/Application Developer/v5.1.2/wstools/eclipse/plugins/com.ibm.etools.websphere.tools.common_5.1.1.1/runtime/wteServers.jar;d:/Programmi/IBM/WebSphere Studio/Application Developer/v5.1.2/wstools/eclipse/plugins/com.ibm.etools.websphere.tools.common_5.1.1.1/runtime/wasToolsCommon.jar
    Java Library path = E:\Programmi\Java\jre1.5.0_03;d:\Programmi\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v51/bin
    ************* End Display Current Environment *************
    i need to use jdk 1.5 for example for new method(1.4.02) of string (ex "".replaceFirst),etc,etc.
    i hope in your.
    hi,hi

    nothing??

  • Installing JDK w/ NetBeans 5.5.1 & JRE 6U1 but not working

    I downloaded and installed both of these on my Ubuntu Linux Machine. When I tried to execute the netBeans application I got:
    'Make sure you have the 'multiverse' component enabled'
    This is a completely new IDE and Language for me, so I am just a clueless newbie.
    What did I do wrong? Thanks.

    I can't really help you with your problem, as i am unfamilar with the install for JDK, but,
    I use Eclipse as my IDE.
    It is mostly useful for its repository share abilities, and enterprise use.
    But, it's free, it works, and its very intelligent.
    You can manage projects, dependencies, packages and such, and install components like NetBeans pretty easily.
    I'm not sure if thats for you, but you should check it out,
    Eclipse Site
    null
    .

  • What are the proper instructions to run an older JRE in Internet Explor ??

    I am unable to use j2re1.3.0_05 with Internet Explorer 6.0.29
    when jre1.5.0_06 is installed on my workstation. Why?

    Under Control Panel -> Java
    in the Java tab (Java Application Runtime settings), click on View...
    You should be able to see all the versions on your system. If you don't see the required version, use Find... to locate it. Enable the version which you want to use and disable other versions.

  • Why Does Installing The JDK On A 64bit OS Install 3 Copys of the JRE???

    I am running Windows 7 Home Premium 64bit version. I recently installed the JDK and realized that along with it 3 copys of the JRE were installed. This is a brand new computer I am running that I just brought home a few days ago so I know there not older versions. Basically what I have is the following; I downloaded the 64bit JDK package and installed it on my system. Now I have the following set up and would like to know if I can safely uninstall any of these as I dont think I need all of them.
    Under Program File(x86) I have the jre6 installed there, that is the 32bit version.
    Under Program Files I have the jre6 installed there, as well as the jdk1.6.0_20 these are the 64bit versions. The troubling thing is that inside the jdk1.6.0_20 folder I have yet another jre installation.
    Now I assume that I need both 32 and 64 bit versions on my system for whatever reason is the case. What I do not understand is why if the jre6 is already installed in both the 32 and 64 bit locations as indicated above, than why does it also get installed inside the jdk1.6.0_20 folder location?? I know that the jre comes bundled with the jdk but is that the jre that is located inside the jdk directory or is it the jre folder????
    Could someone please explain to me exactly how this works and what version i can uninstall??? I am assuming that I can remove the seperate jre6 install that is located in the 64 bit program files location as then that would leave me with the 32bit jre still installed and I would also still have the jre that is installed inside the jdk folder...
    Am I correct on this one??? Also another quick question.... If you need both 32 and 64bit jre's than why don't you need both 32 and 64bit jdks??? Also is it possible to just go ahead and run only the 32bit version on a 64bit machine???
    Thanks in advance for any help

    They bother me because I prefer to keep my system tidy as possible. I do not like to have extra things installed that just waste hard drive space. I am the type of person that keeps my system as clean as my house. I don't like having things laying around that are never going to be used and just waste space. Now in this case apparantly one of these copies of java is not going to be used ever. It makes no sense to me that if the jdk comes with the jre bundled, then why would it also install a seperate jre in another folder when there is already a jre contained within the jdk folder?????
    I understand the purpose of the 32 bit install of the jre, but why would you have the following set up???
    Program Files
    jdk1.6.0_20>>jre
    jre6Program Files(x86)
    jre6Thats 3 copies of the jre and only 1 of the jdk?!?!?! I need one jre for 32bit and one for 64bit, but why the extra copy in the 64bit location???
    You mention uninstalling and reinstalling, but as I said earlier this pc is only a week old and all i did was download the 64bit jdk from the Java website and install it. So all that will accomplish is the same result. My question was trying to figure out if it is safe to remove the extra copy of the jre without losing any functions????? Or would it be better to just remove it all and install the 32bit version???? I read that the 64 bit is for Internet Explorer 64bit which i never use, I use google chrome and firefox which are both 32bit. The thing is though is that the jdk is what I need for programming. Does it matter whether its 64 or 32 bit????
    Edited by: wakeup6620 on Jun 15, 2010 9:48 AM

  • Getting Web Start to use JDK's javaw.exe, not JRE's

    On Windows, I need a Web Started app (actually, my Glossitope desklet) to run with the JDK's javaw.exe, not the JRE's, because I use the Java Compiler API, which is more or less a no-op in the JRE. I've tried using the Java Control Panel to change the Java Application Runtime Settings path to use the JDK path rather than the JRE's, but the change never takes. What, if anything, can I do to get JNLP's to run with the JDK?

    Well, using ToolProvider is exactly what I'm trying to do. The program lets you type some Java code, then compiles it and runs it (with help from a custom class-loader). The problem is that when run from Web Start on Windows, ToolProvider.getSystemJavaCompiler() returns null. I can see from the Control Panel that Web Start's path to Java uses the JRE path, not the JDK, and I suspect that's the reason I'm getting null for the compiler.
    I suspect bundling the tools jar is exactly what I need to do, and I also suspect the license forbids that.
    Works great on the Mac, FWIW.
    Thanks for the reply.
    --Chris                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Why does jdk depend on jre ?

    Installing jdk through pacman calls jre as a dependancy, however, the jdk packages shouldn't require jre (the functionality is included with jdk).
    Note:
    JDK 6 Update 2
    The Java SE Development Kit (JDK) includes the Java Runtime Environment (JRE) and command-line development tools that are useful for developing applets and applications.
    http://java.sun.com/javase/downloads/index.jsp
    and
    Contents of the JDK
    Runtime Environment
    (In the jre/ subdirectory) An implementation of the Java Runtime Environment (JRETM) for use by the JDK. The JRE includes a JavaTM Virtual Machine (JVMTM), class libraries, and other files that support the execution of programs written in the JavaTM programming language.
    http://java.sun.com/javase/6/webnotes/README.html
    In the past, on other distro's I've never installed JRE when I wanted JDK. Is this an error on the maintainers part or...?
    Last edited by steven (2007-07-25 10:45:04)

    Cerebral wrote:
    steven wrote:
    It's simple, the JDK has the runtime environment built in, so there's no need to install both the jdk and the jre. If someone is in the scenario you describe whereby, they have JRE already installed and decide to install the JDK afterwards, then pacman should be able to detect the existing jre and simply remove the runtime environment from the JDK package (which currently happens). I'm simply saying, if someone only wants JDK, don't install 2 seperate packages as the JDK includes JRE anyway.
    Surely in the PKGBUILD or install files in pacman, it can make checks for a pre-existing JRE install (when installing JDK) and only remove the runtime from the JDK, but if there's no pre-existing JRE install, then ONLY install JDK, without removing the runtime.
    My Internet connection is super, so I don't have a big issue with bandwidth, but surely it's better for your mirrors and users who don't have super connections. It also just makes more sense. It seems completely daft to download 60 megs of 2 packages, then delete jre from the jdk and install it seperately. It's bizarre.
    I don't think you understand how our packaging system works... the jdk we provide, that users download from our repos, does not have the "included" jre - users don't download the jre twice.  In your suggestion, they would download the jre twice (once when they install jre, and once again later when they install jdk).
    Besides that matter, it is not a simple thing to dynamically alter the contents of packages at install time - we provide binary packages, pre-built, and the file list of a package is essentially exactly equal to the contents of the tarball you download.
    The way we have it now, only one package in our repos contains the jre, and that's the jre package.  I don't see why you'd rather your package manager sees one package instead of two - you have no duplicate files on your system, and downloaded no extra data (since the binary jdk package doesn't contain the jre at all).
    Ah ok I see, I had the wrong idea.
    AndyRTR wrote:check our jdk PKGBUILD and you will find a line   rm -rf linux-jdk/jre
    This quote gave me the idea that it's download, but then the built in functionality is removed before it's actually installed. Are you saying that this isn't the case?
    shining wrote:You're so good that you don't even need to run the programs you write
    I wish

  • JDK vs JRE

    In production environments it's usual to install the JRE instead of JDK, thinking that JDK contains development tools that shouldn't be in these environments.
    However, there are people who think some of these tools are useful even in a production environment. In fact, Tomcat and other Java software is usually installed over a JDK.
    I would like to know your opinions about this topic. Thankyou.

    A servlet container needs the ability to compile code
    because of JSP. Yeah, but you don't need the whole JDK for that (that's several dozen more Megs of data).
    You can take the "tools.jar" from a JDK and stick it into the JRE's lib directory, and stick that in your classpath. (Tomcat's startup script will handle this automatically).

  • JDK\JRE installation

    Hi,
    I hope somebody can clear something up for me, it's something that has been bugging me and I cant find the answer.
    When I installed the jdk and jre I believe that I got 2 folders, one for each (if this is wrong then please correct me) as the installation times for the folders are 2 minutes apart.
    However when I look in the jdk folder it has a jre folder within in it, that looks to contain all the items from the jre installation.
    Can somebody tell me what is the standard jre you would be using from an installation? The one in the jdk folder or the one in jre folder?
    Is one redundant?
    Thanks

    PaulOckleford wrote:
    By 'the one' in the jre folder do you mean the bin folder? As I dont have a jdk folder in the jre installation directory.There is no jdk folder in the jre installation directory. A jre is intended to provide an execution environment for classes.
    I find this even more strange and I am even more confused now because there is no javac in the bin folder of the jre.javac is available in a JDK and not a JRE. A JRE is intended to be used with classes - those are already compiled and there is no need to have a compiler in there. The JDK is meant for developers and it will have a javac executable.
    I guess then those people can only compile classes from inside their IDE and not from the command line?huh?

  • JDK vs JRE printing differences

    When I use JTextPane.print() from within Netbeans (using JDK 6 u17) my printing works correctly. When I run the same program using JRE 6 u17 (outside of Netbeans) the print() command does not reliably print all of the contents unless I do this: jTextPane.setProperty("i18n",Boolean.TRUE). Any ideas?

    A servlet container needs the ability to compile code
    because of JSP. Yeah, but you don't need the whole JDK for that (that's several dozen more Megs of data).
    You can take the "tools.jar" from a JDK and stick it into the JRE's lib directory, and stick that in your classpath. (Tomcat's startup script will handle this automatically).

  • Difference between JDK/JRE

    Guys,
    I need to know the difference between JDK and JRE? When should one use JDK and when one should use JRE. What is the advantages/disadvantages of using one over other.
    Cheers,

    Shutt up guys... one person is to know some thing about JDK/JRE, and you.....
    Any way
    Hi tnischal!
    Your question was about JDK/JRE
    JDK = Java Development Kit
    JRE = Java Runtime Environment
    JRE is a comolete Setup of J2sdk1.4.1(LatestVersion of JDK(1.4.1) with other requirements to use this version included JDK1.4.1,JavaWebStart,SunJVM,Java2PlatForm, and all other needs for it.
    while JDK is only the Software Development Kit. Previous versions of JDK than V1.4.1 did not need the all Runtime Environment for JDK, You just copy the JDK Folder in your machine and use it
    But you can't use JDK1.4.1(fully) without other requirements of use it.
    Hope you got the difference now.

  • What is the difference between JDK / JRE?

    Hi All,
    What is the difference between JDK / JRE. ?
    Is it enough if I installed JDK 5.0 Update 16 Only or Java Runtime Environment (JRE) 5.0 Update 16 is also needed.
    I as in the assumption that JDK 5.0 Update 16 contains the Java Runtime Environment (JRE) 5.0 Update 16.
    Let me know the jdk which comes along with it jre.
    Thanks
    Sree
    Edited by: psreekant10 on Oct 28, 2008 4:50 AM

    psreekant10 wrote:
    Hi All,
    What is the difference between JDK / JRE. ?JDK = Java Development Kit = Stuff used to write Java programms.
    JRE = Java Runtime Environment = Stuff used to execute/run Java programs.
    Is it enough if I installed JDK 5.0 Update 16 Only or Java Runtime Environment (JRE) 5.0 Update 16 is also needed.Yes, it's enough.
    I as in the assumption that JDK 5.0 Update 16 contains the Java Runtime Environment (JRE) 5.0 Update 16.Yes, the JDK contains a JRE.
    Let me know the jdk which comes along with it jre.<sarcasm>JDK 5.0 Update 16 contains JRE 1.4.2 Update 3, obviously!</sarcasm>
    No, seriously: Of course JDK 5.0 Update 16 contains the JRE 5.0 Update 16.

Maybe you are looking for

  • Apple Wireless Keyboard 'o' key not working

    I have recently acquired a pre-owned wireless keyboard which was working fine until a few days ago. Now the 'o' key has stopped working and some keys do not work with the left shift key - they work fine with the right-shift key and other keys work wi

  • Issue with Audio Playback and Uninterrupted Playback in MPE (Hardware Mode)

    I'm currently using Adobe Premiere Pro CS6 with the latest update (6.0.1). I'm encountering a very serious problem where the audio from my video clips mute sudddenly when I'm editing and playing back. This happens when other music or audio in the aud

  • Where can I download adobe flash player activex?

    Where can I download adobe flash player activex?

  • Corrupted 10g - Universal Installer won't Start - what do I do now?

    Its a sorry tale! Installed 10g - no problems, went fine. Developed OCCI app against 10g. Set up test DB eventually getting some good results! Realize I need 9i compatibility. Installed 9i client. BIG MISTAKE - I think I installed in same home as 10g

  • Is it a bug or is it me?

    I am doing some tests on rejecting connections. I have written the simplest test possible. I have two applications one that always accepts the connection ("acceptApp") and one that always rejects the connection ("rejectApp"). I am running the develop