Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 12 of 12

Thread: JRE and JDK Questions

  1. #1
    Member
    Join Date
    Jun 2011
    Posts
    94
    My Mood
    Amazed
    Thanks
    22
    Thanked 1 Time in 1 Post

    Default JRE and JDK Questions

    Hi,
    I had JDK&JRE7 on my pc, the 64 bit versions of both.

    When I entered a site to play a java game, it directed me to Oracle website to download and install JRE 6_24. Why did that happen?
    Because the applet was coded in 32 bits?
    I thought a newer version will be capable of running an applet coded in a previous version.

    Can you guys explain me why it happened?

    And, if I have an 64 bit JDK, this doesn't mean that 32 bit machines won't run my program, right?


  2. #2
    Super Moderator Sean4u's Avatar
    Join Date
    Jul 2011
    Location
    Tavistock, UK
    Posts
    637
    Thanks
    5
    Thanked 103 Times in 93 Posts

    Default Re: JRE and JDK Questions

    What does your browser say is installed for a Java plugin? Sometimes you can browse about:plugins or something like that. Also there's this:
    How do I test whether Java is working on my computer?

  3. #3
    Member
    Join Date
    Jun 2011
    Posts
    94
    My Mood
    Amazed
    Thanks
    22
    Thanked 1 Time in 1 Post

    Default Re: JRE and JDK Questions

    I couldn't understand your first sentence.

    My browser didn't give any sign, error or prompt. It just redirected me to Oracle website where JDK 6_24 can be downloaded. And I think it was 32 bit.
    I can't tell if my browser is 32 bit or 64 bit because as you may know it is installed in some funny place (C:\Users\beerinbox\AppData\Local\Google\Chrome\Ap plication)

    Well, I checked the way you described (about:plugin on Chrome) and now I have a plugin for that, because I installed it. But I had JRE7 before I got this message. I even tried to install it once again but it said "You already have it."

    I am pretty sure that I could run java on my pc from the beginning. I coded some little applications and applets. I compiled them and ran them using command "java".

    For example, I had to have an 32 bit JDK to run JDownloader. So, does that mean an app which is coded using a 32 bit JDK won't work with a 64 bit JDK and vice versa? This doesn't make any sense to me.

  4. #4
    Super Moderator Sean4u's Avatar
    Join Date
    Jul 2011
    Location
    Tavistock, UK
    Posts
    637
    Thanks
    5
    Thanked 103 Times in 93 Posts

    Default Re: JRE and JDK Questions

    The JRE != Java plugin. The Java browser plugin is sometimes bundled with the JRE, but not always. Ubuntu users are offered a jre_headless which I'm pretty sure leaves it out. What the JRE installer has to do when you install it is attempt to detect any installed (compatible) browsers, and if it finds any, attempt to install the plugin for each one. As a non-Microsoft-OS user with a taste for unloved browsers, I'm well used to failed plugin installs!

    When you browse to about:plugins, it should tell you something like (on mine):
    Java(TM) Plug-in 1.6.0_26
    And that link should open up an applet that tells you something similar. Just so we know where we're at, can you confirm - both ways - what your current Java plugin is?

    I don't know about 32-bit/64-bit incompatibilities in the JVM, my CPUs on my desktop are either Intel or AMD 64bit, but I don't have any more than 2GB in any of my desktops, so they're all 32-bit software to avoid bleeding edge pain and the performance hit from 64bit. Do you need a 64bit JVM?

  5. The Following User Says Thank You to Sean4u For This Useful Post:

    beer-in-box (September 16th, 2011)

  6. #5
    Member
    Join Date
    Jun 2011
    Posts
    94
    My Mood
    Amazed
    Thanks
    22
    Thanked 1 Time in 1 Post

    Default Re: JRE and JDK Questions

    Quote Originally Posted by Sean4u View Post
    The JRE != Java plugin.
    Oh, that explains a lot to me now. Thanks.

    MY browser says: "Java (2 files) - Sürüm: 6.0.270.7
    NPRuntime Script Plug-in Library for Java(TM) Deploy"
    But like I said, I have installed it when the browser directed me to the page.


    Quote Originally Posted by Sean4u View Post
    I don't know about 32-bit/64-bit incompatibilities in the JVM, my CPUs on my desktop are either Intel or AMD 64bit, but I don't have any more than 2GB in any of my desktops, so they're all 32-bit software to avoid bleeding edge pain and the performance hit from 64bit. Do you need a 64bit JVM?
    Well, I have 4 GB RAM (had 2 more but it's broken now), so I use a 64 OS, and I thought 64 bit JVM would be better. I don't think I really need this, but I wanted it to be as compatible as it can be with the OS (Windows 7).

  7. #6
    Super Moderator Sean4u's Avatar
    Join Date
    Jul 2011
    Location
    Tavistock, UK
    Posts
    637
    Thanks
    5
    Thanked 103 Times in 93 Posts

    Default Re: JRE and JDK Questions

    That looks like a Java 6 plugin - is that what you were expecting?

    As far as I know bytecode should be compatible across JVM versions and word-sizes (there have been notable exceptions). There are compiler switches that target particular versions of the JVM, so perhaps the app you're trying has been targeted at Java 7? Also there is an obvious problem with new features in the Java platform, but I'm not sure how 'clever' the plugin would be if it was Java 6 but an application referenced Java 7+ features.

    Do you have a link to the Java game?

  8. #7
    Super Moderator Sean4u's Avatar
    Join Date
    Jul 2011
    Location
    Tavistock, UK
    Posts
    637
    Thanks
    5
    Thanked 103 Times in 93 Posts

    Default Re: JRE and JDK Questions

    I thought 64 bit JVM would be better
    64-bit Java *is better* if you want heap sizes above 1.5GB or so - you just can't do it with a 32-bit JVM. I would doubt there are many applications yet that would benefit from that much heap. My understanding is that for everything else 64-bit JVMs are slower and less well supported.

  9. #8
    Member
    Join Date
    Jun 2011
    Posts
    94
    My Mood
    Amazed
    Thanks
    22
    Thanked 1 Time in 1 Post

    Default Re: JRE and JDK Questions

    Quote Originally Posted by Sean4u View Post
    That looks like a Java 6 plugin - is that what you were expecting?

    As far as I know bytecode should be compatible across JVM versions and word-sizes (there have been notable exceptions). There are compiler switches that target particular versions of the JVM, so perhaps the app you're trying has been targeted at Java 7? Also there is an obvious problem with new features in the Java platform, but I'm not sure how 'clever' the plugin would be if it was Java 6 but an application referenced Java 7+ features.

    Do you have a link to the Java game?
    I am sorry, I don't have the link, so I cannot test it anymore.

    The thing is that, I had Java 7, so if a plugin was installed, it shouldn't have mattered which version it wanted, because I have the latest. But after you said JRE doesn't mean that there is a plugin, it made sense. It appears JRE 7 doesn't have a plugin.


    Quote Originally Posted by Sean4u View Post
    64-bit Java *is better* if you want heap sizes above 1.5GB or so - you just can't do it with a 32-bit JVM. I would doubt there are many applications yet that would benefit from that much heap. My understanding is that for everything else 64-bit JVMs are slower and less well supported.
    I understand you now. I know most of the programs aren't using 64 bit to full extend. So, 32 bit would be okay too. So, should I have Java 32bit even if I have a 64 bit OS?

  10. #9
    Super Moderator Sean4u's Avatar
    Join Date
    Jul 2011
    Location
    Tavistock, UK
    Posts
    637
    Thanks
    5
    Thanked 103 Times in 93 Posts

    Default Re: JRE and JDK Questions

    should I have Java 32bit even if I have a 64 bit OS?
    I would - but I'd be interested to hear other JPF users' opinions. I suspect for a 4GB PC, the advantage from the 64-bit JVM's memory-addressing capabilities will continue to be outweighed by the 32-bit JVM's performance and tried-and-testedness for a little while to come.

    The acid test is - as always - to try both on a workload that is representative of your normal use of your PC and see which is better for you!

  11. #10
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,896
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: JRE and JDK Questions

    64-bit programs take more memory. Each pointer/reference takes 64 bits (hence the 64-bit architecture), while on a 32-bit system they take 32 bits. The obvious trade-off is that you can stick more memory onto your computer (much more than the 2x memory space cost of pointers/references), and not everything your computer does is with pointers/references. Hopefully a good portion of the data is actual data (int's, floats, booleans, etc.), which more or less are the same size (there are no guarantees, but I have yet to run into a situation where this isn't true).

    A 64-bit program should not run slower since the CPU is designed with twice the number of connections to deal with the 64-bits in parallel (I think there was an issue with early 64-bit processors simply being slower, but that's a different story). Maybe in memory accesses there's a slow down, but I think a 64-bit architectures simulate 32-bit systems by filling in the top 32-bits with 0's or some other filler value, leading to no difference.

    Personally I have both the 64-bit and 32-bit Java runtimes installed. Theoretically every Java program should work equally well under both runtimes (the Java bytecode is just a platform-independent intermediate form), but there are certain programs (particularly web browsers) which are only 32-bit so the 32-bit runtime is required, and I have the 64-bit runtime because I do write/use programs which can benefit from the additional available memory space available to 64-bit programs (your typical program likely won't need this much memory). Also, I don't really care if a program takes 2x the runtime memory if it's not that big to begin with.

    Simply put:
    There's no reason not to have both. I tend to default to 64-bits when I can and resort to 32-bits for backwards compatibility or support for 32-bit programs.

  12. The Following User Says Thank You to helloworld922 For This Useful Post:

    beer-in-box (September 16th, 2011)

  13. #11
    Member
    Join Date
    Jun 2011
    Posts
    94
    My Mood
    Amazed
    Thanks
    22
    Thanked 1 Time in 1 Post

    Default Re: JRE and JDK Questions

    Thank you for detailed answer.
    I am a novice programmer (maybe not even a novice) and this is not going to be my profession. I just started this as a hobby and well, it is deeper than I expected it to be
    I told you this, because now I learnt that I will never need a 64bit JDK, not in a near future at least.

    So, does that mean it would be better if I use 32 bit jdk instead of the 64bit one? And a program I compiled with 64 bit jdk will work in 32 bit jvm?

    About JVM versions, I thought having both would cause problems but it appears that it won't cause any problems. So, I am gonna use them both. If I understood you guys, you say if the program which calls jvm is 32 bit, it calls 32 bit jvm and doesn't recognize 64bit. Is that correct?

  14. #12
    Super Moderator Sean4u's Avatar
    Join Date
    Jul 2011
    Location
    Tavistock, UK
    Posts
    637
    Thanks
    5
    Thanked 103 Times in 93 Posts

    Default Re: JRE and JDK Questions

    Is that correct?
    I can't help you with multiple JVM versions - that sounds like a mess to me. I notice from a recently-posted link for Java WebStart though, that webstart will automatically download JVMs to match applications if it needs to. I doubt that's a word-length issue, more to do with missing features in older versions of the API.

Similar Threads

  1. Many questions
    By SharpT in forum What's Wrong With My Code?
    Replies: 11
    Last Post: January 18th, 2011, 08:56 PM
  2. Inheritance questions....
    By smellyhole85 in forum Java Theory & Questions
    Replies: 1
    Last Post: November 26th, 2010, 05:11 PM
  3. A few questions
    By adenverd in forum Java Theory & Questions
    Replies: 3
    Last Post: May 26th, 2010, 03:34 AM
  4. [SOLVED] Some serious questions,
    By Time in forum What's Wrong With My Code?
    Replies: 3
    Last Post: May 17th, 2010, 02:52 AM
  5. Java Questions! :)
    By xs4rdx in forum Java Theory & Questions
    Replies: 0
    Last Post: February 21st, 2010, 07:40 AM