Platform independency...any chance ?

hi...java code (.class files ) are platform independence. It is supposed to run any platform.(i believe this) [ // it is fine in different  windows machine ].
However, i was in argue with my friend..... He told that each platform (windows,Unix,Macintosh) have different JVM . so there is a chance that the class file may be rejected by the JVM in different platform.
is it true ?
if Yes.......then independency is lost !!! i can not call it is a pure platform independent.......are people trying for any remedy ?

There are many different JVMs. Sun makes JVMs, IBM makes JVMs, M$ used to make JVMs, I think Blackdown makes JVMs, etc.
As long as a JVM matches the spec, then a given class file is portable across different VMs. Just like if I create a Word doc on the PC, I can read it with word on my Mac.
BUT (you knew there was going to be a "but", didn't you), there are different versions of VMs and the spec has changed over the years. Just like MS Word from 1990 probably won't read a document you create with the MS Word that you buy today, similarly you need to make sure the version of your class file is no newer than the VM. If the class file is an older version than the VM, it will generally work--they're backward compatible that way. Or is it forward compatible.
Also, there are things that are legal Java code that won't necessarily translate from one platform to another that well. GUI stuff can be slippery that way, I understand. Some other things too, but I forget what.
Is Java perfectly platform independent in that any class file generated anywhere anytime is guaranteed to run on any other VM? No, of course not.
Is it easy to create applications that you can run with no changes on Mac, Windows, Linux, Solaris, and maybe others that I'm not aware of? Absolutely. Many of the apps I've developed in the last few years have been developed and unit-tested on Windows (and even Mac to some extent) and run on Linux or Solaris, without me even needing to think about it. (Not that you never need to think about it, but it's not an overriding concern.)

Similar Messages

  • The symbol "/" in properties file is platform independent ?

    Hi!
    In my properties file I set many patha to my any resources(path to my icons, path to my user XML file and so on):
    # content of my properties file
    userSettingsPath=config/usersettings.xml
    baseNameImages=/resources/images/
    # end
    As you see in path I use symbol "/" to create path.
    This work in Windows platform. Is this will work in other platforms?
    Is symbol "/" is platform independent?

    It works as a separator in Java, actual separators in the OS may vary.

  • Why java is platform independent ?

    what is the meaning of java is platform independent ? is it just because of java code can be run in windows/linux/unix platform ? but then C/C++ also can be run in windows/linux/unix . so why those are not called platform independent ?
    why java is called platform independent ?

    c/c++ creates object code . similary java creates bytecode . java uses interpreter JVM to execute . similary c/c++ object code also executes in any platform. so where is the real difference ?
    the classes do not need to be recompiled for different platforms. what do u mean by this ? ".....classes ( i.e bytecode) dont need recompilation ..." .....ok....but same thing is true for C/C++ object code also !! they also dont need recompilation.
    where is the difference ?

  • Platform independency

    I have developed an implementation of High Availability Servers using Java in Linux. But the problem is it runs only in Linux because I have used the System class to execute a native OS command "ipconfig eth0 192.168.0.0.123" to change the Ip of the system.Is there any way to go around this so that the code becomes purely platform independent?
    One option is to detect the OS that is currently running and execue the appropriate System command using a switch statement.So is it possible to detect the underlying OS?If so , what is the command for changing IP in Mac OS, Windows....and any others which u can think of.
    HELP.

    Here is some basic code I wrote a LONG time ago:
         public static final int OSTYPE_WINDOWS = 1;
         public static final int OSTYPE_WINNT = 2;
         public static final int OSTYPE_WINCE = 3;
         public static final int OSTYPE_LINUX = 4;
         public static final int OSTYPE_MAC = 5;
         public static final int OSTYPE_SOLARIS = 6;
         public static final int OSTYPE_NETWARE = 7;
         public static final int OSTYPE_OS2 = 8;
         public static final int OSTYPE_UNKNOWN = 9;
         private static int type = OSTYPE_UNKNOWN;
              @return an integer identifying the OS (one of the OSTYPE constants)
         public static int getOs()
              if(type == OSTYPE_UNKNOWN){
                   String osname = System.getProperty("os.name").toLowerCase();
                   if(osname.indexOf("windows") != -1){
                        if(osname.indexOf("nt") != -1 || osname.indexOf("2000") != -1 || osname.indexOf("xp") != -1){
                             type = OSTYPE_WINNT;
                        } else if(osname.indexOf("ce") != -1){
                             type = OSTYPE_WINCE;
                        } else {
                             type = OSTYPE_WINDOWS;
                   } else if(osname.indexOf("linux") != -1 || osname.indexOf("bsd") != -1){
                        type = OSTYPE_LINUX;     
                   } else if(osname.indexOf("mac os") != -1 || osname.indexOf("macos") != -1){
                        type = OSTYPE_MAC;
                   } else if(osname.indexOf("solaris") != -1){
                        type = OSTYPE_SOLARIS;     // could also be old freebsd version
                   } else if(osname.indexOf("netware") != -1){
                        type = OSTYPE_NETWARE;
                   } else if(osname.indexOf("os/2") != -1){
                        type = OSTYPE_OS2;
                   } else {
                        type = OSTYPE_UNKNOWN;     
              return type;
         }

  • Why java is called platform independent? "write once, run anywhere" code...

    I do have a answer for this. Please shed some light whether i am right or wrong.
    When you say java as platform independent, it means that, any java program once compiled to java class can be transferred to anyother machine(say, from windows to unix) can be executed, provided the destination machine has JVM.
    where as, in C/C++, if we transfer the object files from one machine to another machine, they will not be executed and they have to be re-compiled in the other machine.
    Am i correct?
    please, do give me your idea on this...
    thanks...

    Thanks george !

  • Why java is called platform independent

    Hello
    Why java is called as platform independent?Any body please give a detailed explanation since im a beginner to java technology.
    ThankYou
    Jk

    BigDaddyLoveHandles wrote:
    georgemc wrote:
    SunFred wrote:
    Java is not platform independent since it depends on the Java platform ;)Don't complicate matters!I always thought the phrase should have been "platform agnostic"It's a phrase I've used meself

  • Is Java Byte Code is 100% platform independent

    Hi all
    A my room fellow is disturbing me about the platform independency of JAVA.
    Now i only wan to know that generated Byte Code will be same if it is generated on different platforms (Window,Linux,Unix etc)using their respected JVM
    Thanks in advance

    The "Platform Independency" of Java is a bit of a joke
    to me. You need a JVM that is platform dependent to
    run it. Now granted, you can write one application
    and itll run on any platform, but that's only assuming
    they have the JVM installed on them. Not to say that
    Java isn't cool and all, but the "platform
    independency" solution still has a reliance on
    something that is platform dependent... It's like
    driving an automatic and saying you can drive....Sure,
    you are making the car go, but something is doing the
    shifting for you....(C: I guess I'm just arguing for
    the sake of arguing...Well if you want to argue that point then no language is platform independant. C code for instance needs a compiler for the platform you want to compile it to run on and that compiled code won't work on any other platform. Ultimately every program has something that ties it to a particular platform, that's just the nature of things in computers.
    The idea of platform independance was the removal of the need to re-compile a program with a native compiler just to get it to run on that platform.
    Instead Sun opted to have a compact JVM to interpert the byte code and have the byte code standard across all implementations of the JVM.

  • Sharepoint Foundation 2013 on Windows Server 2012 R2 Essential - any chance to install?

    Understood that it's impossible to install SharePoint as it is not supported on a domain Controller BUT is there any chance to install instead SharePoint Foundation 2013 on a Essential Server?

    Hi: 
    Seems so, although as you know it would be better on a member server as a VM.
    http://www.em-soft.si/myblog/elvis/?p=305
    Larry Struckmeyer[MVP] If your question is answered please mark the response as the answer so that others can benefit.

  • Any chance I can use PC3200 (ECC) from my PC in my iMac?

    I write 'my iMac' with faith, as I don't have one yet, but I'm getting closer and closer to pulling the trigger (and selling my powerbook to finance it). You see, I'm basically poor. I've got an open tab in this very browser for a 2gb kit of Corsair Value Select ($217). I've also considered a single gig stick (bringing me up to an unmatched 1.5gb). Then I had a crazy notion:
    "My PC, which I hardly use any more due to the gruesome inferiority of XP to OS X, has 2x512mb PC3200 sticks in it... XP doesn't know what to do with anything more than 512!"
    They are both ECC sticks, but my understanding is that ECC can work in non-ECC setups, but not vice versa. If you mobo requires ECC, you need ECC, but the ECC functionality can be not used and it'll work like non-ecc memory. Sorry if that wasn't clear, but I'm pretty sure my current mobo doesn't acknowledge or use ECC, yet my ECC ram is running fine. ECC stands for Error Correcting SOMETHING, btw. Servers often use it, runs a bit slower but more stably than non-ECC. Anyway, I've got two chips, a samsung and a crucial chip, and I'm hoping that IF they'll work at all, that one of them would 'match' whatever 512 chip Apple sends stock. Then I can get by with the iMac running on 1gb.
    Am I a crazy cheap-skate? The other thing I considered slyly was 'Why not buy that 2gb kit and stick the spare 512 in the PC - then I can run BitTorrent, Google Earth AND a game at the same time on 1.5gb and stave off upgrading to an Intel iMac for another 6 months (ie. 2008?) because I also have 2gb in my iMac.'
    Thanks for your input.
    Alex
    p.s. if anyone knows if the spanning hack has any chance to output to DVI, please let me know - or look at my other post - thanks.

    Alex,
    Apple says:
    "Important: DIMMs with any of the following features are not supported in the computer: registers or buffers, PLLs, ECC, parity, or EDO RAM."
    However, my understanding of the language "not supported" is that they might work, anyway, but if something goes wrong it's not Apple's fault.
    With as many iMacs as are in use, there must be someone else who has tried ECC chips, if they are willing to own up to it:-)

  • My new Ipod touch 5 32GB is stolen is there any chance to be find if i don't have iFind

    My new Ipod touch 5 32GB is stolen is there any chance to be find if i don't have iFind....is it possible that people from apple can trace ipod useing serial No. or something.

    Sorry... No.
    What to do if your iOS device is lost or stolen
    http://support.apple.com/kb/HT5668

  • Just bought a new iphone 5 i have an old imac computer OSX 10.5.8 and itune version 10 (updated at great cost last year for iphone4) it dosen't let me restore data... any chance of update or do i have to thow away my computer (and never by Mac aga data 0

    Just bought a new iphone 5, i have an old imac computer OSX 10.5.8 and itune version 10 (updated at great cost last year for iphone4) it dosen't let me restore data... any chance of update or do i have to thow away my computer (and never by Mac again?)

    You an use your iPhone without connecting it to a computer.
    But the product description for the iPhone clearly states that in order to sync with a Mac you must have OSX 10.6.8 or later. That version of the OSX is usually called Snow Leopard. There are two mo recent versions of OSX. OSX 10.7.x (Lion) and OSX 10.8.x (Mountain Lion).
    If you can upgrade your computer to at least Snow Leopard I suggest you do so.

  • Another iPod locking up -- any chance of service from Apple?

    Yesterday, it froze in the middle of a song at 5:21 (according to the clock display) and never came unfrozen. The battery died, I plugged it in when I got home, it charged overnight, and I was listening to a song today and it froze again. The advice of resetting it hasn't helped. When it's frozen, I tried four or five times to reset it, and it just won't do anything. It even stays lit up the whole time! When I first got my iPod, it could take literally hours for iTunes to recognize it in the source list, even though the computer knew it was there. I don't think that's related, but oh, well. And of course, a fourth-gen isn't really covered anymore in their service policy. I got it in Sept of 05, and already used my one free call. I haven't yet been able to get through to an actual person, but I'm planning on it.
    So, two questions:
    1) any clue what the problem with these iPods is?
    2) Any chance the people at Apple would be willing to replace it with a working, SERVICEABLE model?

    And of course, a fourth-gen isn't really covered anymore in their service policy.
    The warranty is for one year after purchase.
    If you bought it new in Sep 05, its still covered.
    already used my one free call. I haven't yet been able to get through to an actual person, but I'm planning on it.
    If you have not spoken with an actual person, you have not used your one free support.
    But that is only good for the first 90 days anyway. After 90 days, it'll cost.
    Try the 5Rs on this page.
    http://www.apple.com/support/ipod/
    If this does not solve the problems, you can request service for your iPod at an Apple Retail store or here.
    http://depot.info.apple.com/ipod/

  • In the process of saving a file a power surge rebooted computer. Any chance of recovering file?

    In the process of saving a file a power surge rebooted computer. Any chance of recovering file?

    Have a look at the sample script below. The "while" loop waits for the specified number of milliseconds, then reads the contents of a directory and processes every individual file in the directory. In my example, it just prints the file path to the console. You would replace this part with your Open / Save as / Move sequence.
    For more file system commands, refer to Adobe's Javascript Tools Guide, "File object functions".
    var stop = false;
    while( stop==false ) {
        // Wait for 20.000 ms
        $.sleep(20000);
        var fld = new Folder("c:/incoming");
        var filesInFld = fld.getFiles("*.fm");
        for(var f=0; f < filesInFld.length; f++) {
            // process the individual file
            $.writeln(filesInFld[f]);
        // Exit the  loop after 19:00
        var time = new Date();
        if( time.getHours() > 19 ) stop = true;

  • Adobe Creative Suite 5 Web Premium Student and Teacher - Is there any chance to get a CC discount?

    Hi there.
    I'm currently a user of Adobe Creative Suite 5 Web Premium which I bought when I was eligible for Student&Teacher version. I'm not a student, neither a teacher anymore. Is there any chance to get a discount for Creative Cloud?
    I thought I would be able to get a discount due to the fact I have previous version of Adobe software, but it seems that it is not for people who bought S&T versions.

    Hi,
    first of all look at your "Help" on top, where you could go to this:
    http://www.adobe.com/ap/support/contact/ ("Need a different country or region?" = Asia Pacific - English) or
    http://www.adobe.com/support/service/
    Also what concerns the service from ADOBE support I personally made very good experiences with the telephone hotline.
    All other product help
    800-833-6687
    Monday-Friday, 5am-7pm PST
    And particularly well I found that Adobe now also offers the chat. All I can give you this link:
    http://kb2.adobe.com/cps/403/kb403784.html#Free Support
    To 1.: Did you read Adobe's terms and conditions? If so, the question should answer itself. Student version prohibit commercial work, I could read it in a former thread, an academic version would allow it and come with full upgrade rights. (You could use search function here on top.)
    To 2.: Since I have no experience, I would even here use Adobe's or Google's search function.
    To 3. Yes.
    Hans-G.

  • Any chance the Mac mini and the Apple TV will be combined into one unit?

    Any chance the Mac mini and the Apple TV will be combined into one unit?

    No.
    The Apple TV is the guts of an iPad without the screen or battery running a different build of the OS. Ie, its very cheap to make and runs an ARM processor (like all iDevices)
    The Mac mini is 6x the price and is a full intel computer running the OS X.
    Now, it could be that the Apple TV gets more powerful and its OS more diverse and "computer like" (apps + iCloud for example), but for now they're still coming from totally different directions.
    They just happen to look alike

Maybe you are looking for

  • Color Space Management & Final Color Output-not WYSIWYG?

    I have constantly had problems with getting final output color to match what i am seeing on my monitors when color correcting. This has been a continual problem mainly with R3d footage and going to Prores...but for the sake of this discussion here is

  • Problem while calling a Webservice from a Stand alone java program

    Hello Everyone, I am using a java program to call a webservice as follows. For this I have generated the client proxy definition for Stand alone proxy using NWDS. Now when I call the method of the webservice I am getting the correct result but along

  • Creation of invoice issue for a specific supplier

    When the user is trying to create an invoice for a supplier, he is able to query the supplier name, the site. But when arriving at the invoice date the system will not allow him to move. There are no error messages. Grateful if anyone can pinpoint me

  • Can iSyncPluginMaker be downloaded as standalone version *without XCode*?

    Hello! Is there any way to download *only* iSyncPluginMaker without having to download the free but enormous Xcode (1.68 GB!!!) ? Otherwise, could someone be so kind and send me the application or a link to it? Many thanks in advance!

  • Copy of FBL5N report

    Hi Friends, I have to add new pushbuttons in the application tool bar of standard FBL5N report output. For that i have copied FBL5N into ZFBL5N and also copied status  'ALV_ITEMS_AR' into  'ZALV_ITEMS_AR' and copied the function  'FI_ITEMS_DISPLAY' i