Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Java on 64bit & 32bit systems

  • 07-09-2012 3:09pm
    #1
    Registered Users, Registered Users 2 Posts: 266 ✭✭


    I am about to enter my third year as a Computer Science student studying Java. Last year I kept running in to an issue when I was handing in assignments. It involved the opening of jar files which I had created for programs that I was tasked to do. The thing is I did a lot of work on these on my home desktop which is a 64bit system. The IDE I used was eclipse 64bit and I had Java 7 SDK 64bit installed.
    If I compiled these programs at home and created a jar file they would run ok but they would not run on my college's computers which were 32bit systems with Java 7 SDK 32bit installed.

    Is this an issue and so should I use Java 7 SDK 32bit on my home system?

    I know the simple answer is yes 64bit compiled programs will not run on 32bit systems due to different architecture but isn't Java platform independent? Other students with 64bit laptops were able to open jar files on the 32bit college systems. Although maybe they had Java SDK 32bit installed.

    Does it matter whether I use eclipse 32bit or 64bit on my home system?

    If anybody has any experience of this or can shed any light on this I would greatly appreciate their input.

    Thanx

    Ger


Comments

  • Closed Accounts Posts: 2,267 ✭✭✭h57xiucj2z946q


    Use 32bit JDK and eclipse for now for highest compatibility.

    Infact on Windows 7 64bit, the default java install that java.com recommends is 32bit. IE on 64bit Windows by default runs in 32bit mode also. I guess this is to maintain compatibility with 3rd party add-ons and plugins.

    http://www.java.com/en/download/faq/java_win64bit.xml


    Unless your application is going to consume huge amounts of memory, you won't notice any difference.


  • Closed Accounts Posts: 8,015 ✭✭✭CreepingDeath


    Gerb68 wrote: »
    The thing is I did a lot of work on these on my home desktop which is a 64bit system. The IDE I used was eclipse 64bit and I had Java 7 SDK 64bit installed.
    If I compiled these programs at home and created a jar file they would run ok but they would not run on my college's computers which were 32bit systems with Java 7 SDK 32bit installed.

    Is this an issue and so should I use Java 7 SDK 32bit on my home system?

    If you used pure Java, ie. no C-Callable native methods, then it should run fine on both 32 & 64 bit machines without modification.

    The Java class file format is completely processor independent.
    If makes no assumptions on the register size, processor type etc.
    The platforms Java Runtime Environment worries about processor dependant optimisations and limitations not you.

    Did you have a batch file declaring more than 2Gb of heap size when starting your program?

    Or did you use something like Winzip / 7-Zip to create a jar file instead of using the standard Jar tool / Ant Task / Maven build file?

    Something doesn't sound right here.
    Or maybe you use Windows at home and Linux for the college assignments and tripped up with shell scripts or the like?


  • Registered Users, Registered Users 2 Posts: 266 ✭✭Gerb68


    No. There was no batch file with declarations.

    Home PC and College computers are both running Windows 7

    Jar files were created using eclipse.

    The only difference that I can tell is the bits.


  • Registered Users, Registered Users 2 Posts: 2,013 ✭✭✭lynchie


    No problem running class files on either 32/64 bit jvms..

    What is the exact error you get?

    My bet is on an UnsupportedClassVersionError possibly due to running on differing jvm versions.


  • Registered Users, Registered Users 2 Posts: 1,645 ✭✭✭k.p.h


    lynchie wrote: »
    No problem running class files on either 32/64 bit jvms..

    What is the exact error you get?

    My bet is on an UnsupportedClassVersionError possibly due to running on differing jvm versions.

    not 100% but i think this might be right


  • Advertisement
Advertisement