Platform Independent

Java is platform independent.What do u mean by paltform independent?

platform Independent does'nt mean once compiled
its means it can run without the help of platorm(os)
jvm provides pltfom indepent to java but
jvm is also os specific means there is different jvm for widows ,
different for linux,and diiferent for mac
there is two layers in jvm
first interact with byte code
& second interact with platform(os)
in mobile applicatoin jvm directly produce output bcz jvm is interpreator

Similar Messages

  • Java platform independent.what is a platform?

    This question has been haunting me for a long time.
    When we say Java is platform independent,what does the term platform
    indicate?
    I think it is Processor+Operating System.
    But people talk only of Operating System as platform.
    A processor has its own instruction set that is different from that of other processors.An executable code on one processor doesn't run on another processor,whatever may be the operating system.
    Java code is platform independent because it is just compiled to byte code and that byte code is interpreted and run on a JVM.Here the JVM is different for different platforms.
    My question is:
    consider two platforms:
    Intel Pentium+MS Windows.
    and AMD Athlon+MS Windows.
    Is the same JVM used for both these platforms?or not?WHY?
    If only Operating System is Considered as platform,what happens to the underlying processor?

    <troll style="flamesuit: on;">Java is not plateform inderpendent, java runs on one plateform, the Java Platform.</troll>
    The "Intel / AMD + MS Windows" is two forks of one plateform, the x86 / Windows plateform.
    You could extends the x86/Windows JVM to include Intel extras in such a way that it would not run on AMD/Windows.
    One way you could define a plateform is as a binary format, processor intuction set and public API.
    So java == .class format, bytecode and the java.* packages
    and Linux x86 == ELF, x86 and POSIX (plus others, such as X)
    and FreeBSD x86 == ELF, x86 and POSIX (plus others, such as X)
    and Cygwin == ELF, x86 and POSIX (plus others, such as X)
    and Windowsx86 == PE, x86, MFCs
    But does that mean Linux, FreeBSD and Cygwin are the same plateform, well kind-of, they are all unix-sqe, and in some cases the binarys are interchangable (a small plug in to FreeBSD will let you run Linux software, the same sort of thing is aviable to Solaris, and some very small (hello world-level) will actually run (I've seen this in the case of a Linux HelloWorld on a BeOS machine).

  • 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.

  • Java is   NOT   Platform Independent ????????

    Hai.
    My friend told ...
    we can able to say java is platform independent.
    but
    in one company (software anaylist) ask
    talk about java is not platform independent...
    so how its possible..
    plz i want clear cuts...
    even i search in google also.. but i cant get clearlly.........
    yours
    advance happy pongal and upcomming festivals
    drvijayy2k2

    >
    A quick example I recently encountered of platform
    dependence was in character encoding/decoding. Have
    a look at how Solaris, Linux and Windows print out
    the full range of bytes when they are encoded as
    Strings. There are lots of little differences, happy
    discovering.This is a good illustration. By default java uses the character encoding which it believes to be in general use on the platform it's running on, but you can specify the character encoding explicitly. So, by default, the Java program addapts it's exact behaviour to the platform.
    Is "a platform independant" program one which produces the same file format on systems which will interpret that file format different ways? Or is it one that generates a file format that will produce equivalent results on two different systems?
    There's a similar dilema with "look and feel" (i.e. window gadgets etc.). Should a platform independant program use the same look and feel on systems whose native look and feel is different, or should it "blend in"?
    Java leaves these choices to the programmer.

  • 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 ?

  • How do u say java is platform independent

    how do u say java is platform independent.....when a .class file for a program cannot be executed in another system with no java installed in it.......

    Pictograms are language independent (sort of)
    do you expect them to work in the land of the blind?

  • 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;
         }

  • Oracle Universal Installer response files and platform independency

    Hi all,
    The Oracle Universal Installer is a platform-independent system, to what extent are Oracle Universal Installer response files platform-independent? For sure it's not completely platform-independent, because path definitions aren't portable - Windows versus Linux for example. My hope is that all possible variables within response files are exactly the same as on different platforms. Also the possible values for the variables should be portable, except for the path definitions, of course.
    Can anyone confirm that my thoughts are true?
    Durk

    Hi,
    This problem frequently occurs because of the wrong DISPLAY settings. Please perform the steps on a X-term terminal screen;
    1) under root user
    2) xhost +
    3) su - ora<sid>
    4) echo $DISPLAY
    5) setenv DISPLAY <client ip>:(result of echo $DISPLAY) (for example setenv  DISPLAY 192.168.1.100:0.0)
    6) xclock (test X-Client)
    If it works then you will be able to run "./runInstaller", for example
    cd /oracle/stage/102_64/database/Disk1/SAP
    ./RUNINSTALLER
    You can check the [installation guide|https://websmp204.sap-ag.de/~sapidb/011000358700000359232008E], also. Search for "4.4.3 Running the Oracle Universal Installer" title and read the details,
    Best regards,
    Orkun Gedik

  • 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

  • Software development is platform independent?

    ORACLE Database has features like having database triggers, stored procedures / functions, table or column level constraints. So are they proprietary functionality of ORACLE. Can I build some of these above-mentioned features using standard SQL? Am I violating the proprietary law?
    The current trend of software development is platform independent? How to achieve this?
    null

    I have had this problem before, I think you can use
    something like:
    System.getProperty("path.separator");But I am not at work right now to look, so sorry. Im
    sure someone else could confirm this.No, it's file.separator:
    file.separator      File separator ("/" on UNIX)
    path.separator Path separator (":" on UNIX)
    line.separator      Line separator ("\n" on UNIX)
    But better use File.separator instead of a hardcoded string -> compiler will complain at typos.
    -Puce

  • Determining free disk space in a platform independent "java-like" way?

    how can i determine free disk space in a platform independent "java-like" way?

    Search the forum "free disk space".

  • Platform-independent handling of newlines in captions

    LR 3 should handle newlines in captions in a platform-independent manner.
    Currently on Windows, captions containing newlines represented by a single newline character ("\n") don't display properly in the Metadata panel, both in the Default and Large Caption presets.  Only newlines represented DOS-style ("\r\n") display properly.   If you enter a newline in the Large Caption preset, then it gets stored in DOS-style format ("\r\n").
    This creates problems when moving metadata to and from other programs and platforms. For example, Photoshop Elements generates a single newline character ("\n") for newlines in metadata.
    It would be better for LR to do what most modern Windows programs do when faced with the need for platform-independent data: Accept either format ("\r\n" or "\n") and display it properly as a single newline.  When newlines are entered into the Metadata panel, store them as a single "\n" character.

    The current behavior is a littler messier than I thought: I you enter a caption with newlines via the Metadata panel, they are stored in the catalog in DOS format (\r\n).  If you then do Save Metadata To File, the newlines get stored in Unix format (\n), which is good.  But if you then do Read Metadata From File, the Unix-format newlines replace the DOS-format nelines in the catalog, and they no longer display properly.
    This is more properly called a bug than a feature request, so I'll file a bug report.

  • Need platform independent java code for TNS PING

    Hi, I am able to ping server /ip address. but unable to ping some TNS entry.
    There is one way to ping TNS entry using System command, but that will make my code platform dependent. i want platform independent code.. need code help for TNS Ping to database server.. here are my code:
    ---Code for server / Ip address ping:---------
    package DBM;
    import java.io.IOException;
    import java.net.InetAddress;
    import java.net.UnknownHostException;
    import java.util.ArrayList;
    import oracle.net.TNSAddress.*;
    public class PingServer
    public static void main(String[] args)
    System.out.println(" Server Pinging Starts...");
    ArrayList<String> list=new ArrayList<String>();
    list.add("g5u0660c.atlanta.hp.com");
    list.add("g1u1675c.austin.hp.com");
    list.add("gvu1785.atlanta.hp.com");
    list.add("10.130.14.109");
    list.add("10.130.0.173");
    list.add("DESCRIPTION = (SDU = 32768) (enable = broken) (LOAD_BALANCE = yes) (ADDRESS = (PROTOCOL = TCP)(HOST = gvu1515.atlanta.hp.com)(PORT = 1525))(ADDRESS = (PROTOCOL = TCP)(HOST = gvu1785.atlanta.hp.com)(PORT = 1525)");
    list.add("IDSENGI");
    //This Ipadd variable is used to convert the arraylist into String
    String ipadd="";
    try
         for(String s: list)
              ipadd=s;
              // InetAddress is class.in this class getByName()is used to take only string parameter.
              InetAddress inet = InetAddress.getByName(ipadd);
              //InetAddress inet1 =InetAddress.getAllByName("IDESENGP");
              System.out.println("Sending Ping Request to " + ipadd);
              //in InetAddress call IsReachabe(3000)method is used to ping the server IP and if ping is successfully then return true otherwise false.
              //IsReachable()take time in millisecond and return type is boolean.
              System.out.println("Host is reachable: "+inet.isReachable(3000));
         System.out.println("Server Pinging program is working fine........");
    catch (UnknownHostException e)
         System.err.println("Host does not exists");
    catch (IOException e)
         System.err.println("Error in reaching the Host");
    ----Code for TNS ping using system host----
    package DBM;
    import java.io.*;
    public class doscmd
    public static void main(String args[])
    try
    Process p=Runtime.getRuntime().exec("cmd /c tnsping IDSENGP");
    p.waitFor();
    BufferedReader reader=new BufferedReader(new InputStreamReader(p.getInputStream()));
    String line=reader.readLine();
    while(line!=null)
    System.out.println(line);
    line=reader.readLine();
    catch(IOException e1) {}
    catch(InterruptedException e2) {}
    System.out.println("Done");
    The above two codes are working absolutely fine... but need TNS ping program is platform dependent..we need to deploy it in both windows, unix...
    Please help.

    You don't need to install another JDK, just use the api from 1.2 and you should be fine. You can even use the 1.4 jdk to compile as if it were 1.2 by using the -target option in javac.

  • Platform Independent , Reality or Myth

    Does Java Platform independent in reality ??
    Or in reality Java is a combination of Platform Independent Complier with Platform Dependent Interpreter !!!!

    After checking out the link
    http://java.sun.com/docs/books/tutorial/getStarted/int
    ro/definition.html
    We can conclude at the same point which I raised
    earlier ,i.e , Platform Independent Compiler with
    Platform dependent Interpreter (JVM).the compiler is not platform independent, the code it produces is though
    can't you see the difference ? you don't have to recompile your code to port it to another environment, you just have to make sure that the JVM is installed in this environment
    think about applets, the advantage may seem clearer

Maybe you are looking for