Unterschied Unix und Windows



  • Du sollst ja auch einen String übergeben und nicht eine Nichtvorhandene Konstante 😉

    System.out.printkln(System.getProperty("os.name"));
    


  • Hey MEGALOL! 😞

    Na klar hast ja recht hab ich gar ned gesehn! 🙄

    Mega THX! 😃


  • Mod

    Da kann man sich doch mal schnell ein kleines Testprogramm schreiben:

    import java.util.*;
    
    public class PropertyTest
    {
       public static void main (String [] args)
       {
          Properties prop = System.getProperties();
          Enumeration keys = prop.propertyNames();
          while (keys.hasMoreElements())
          {
             String key = (String)keys.nextElement();
    	 System.out.print (key);
    	 System.out.print (" : ");
    	 System.out.println (prop.getProperty(key));
          }
       }
    }
    

    Output bei mir:

    java.runtime.name : Java(TM) 2 Runtime Environment, Standard Edition
    sun.boot.library.path : /usr/lib/SunJava2-1.4.1/jre/lib/i386
    java.vm.version : 1.4.1_02-b06
    java.vm.vendor : Sun Microsystems Inc.
    java.vendor.url : http://java.sun.com/
    path.separator : :
    java.vm.name : Java HotSpot(TM) Client VM
    file.encoding.pkg : sun.io
    user.country : DE
    sun.os.patch.level : unknown
    java.vm.specification.name : Java Virtual Machine Specification
    user.dir : /home/Otaku/TestProjects
    java.runtime.version : 1.4.1_02-b06
    java.awt.graphicsenv : sun.awt.X11GraphicsEnvironment
    java.endorsed.dirs : /usr/lib/SunJava2-1.4.1/jre/lib/endorsed
    os.arch : i386
    java.io.tmpdir : /tmp
    line.separator :
    
    java.vm.specification.vendor : Sun Microsystems Inc.
    os.name : Linux
    sun.java2d.fontpath :
    java.library.path : /usr/lib/SunJava2-1.4.1/jre/lib/i386/client:/usr/lib/SunJava2-1.4.1/jre/lib/i386:/usr/lib/SunJava2-1.4.1/jre/../lib/i386
    java.specification.name : Java Platform API Specification
    java.class.version : 48.0
    java.util.prefs.PreferencesFactory : java.util.prefs.FileSystemPreferencesFactory
    os.version : 2.4.20-4GB
    user.home : /home/Otaku
    user.timezone :
    java.awt.printerjob : sun.print.PSPrinterJob
    file.encoding : ISO-8859-15
    java.specification.version : 1.4
    user.name : Otaku
    java.class.path : .
    java.vm.specification.version : 1.0
    sun.arch.data.model : 32
    java.home : /usr/lib/SunJava2-1.4.1/jre
    java.specification.vendor : Sun Microsystems Inc.
    user.language : de
    java.vm.info : mixed mode
    java.version : 1.4.1_02
    java.ext.dirs : /usr/lib/SunJava2-1.4.1/jre/lib/ext
    sun.boot.class.path : /usr/lib/SunJava2-1.4.1/jre/lib/rt.jar:/usr/lib/SunJava2-1.4.1/jre/lib/i18n.jar:/usr/lib/SunJava2-1.4.1/jre/lib/sunrsasign.jar:/usr/lib/SunJava2-1.4.1/jre/lib/jsse.jar:/usr/lib/SunJava2-1.4.1/jre/lib/jce.jar:/usr/lib/SunJava2-1.4.1/jre/lib/charsets.jar:/usr/lib/SunJava2-1.4.1/jre/classes
    java.vendor : Sun Microsystems Inc.
    file.separator : /
    java.vendor.url.bug : http://java.sun.com/cgi-bin/bugreport.cgi
    sun.cpu.endian : little
    sun.io.unicode.encoding : UnicodeLittle
    sun.cpu.isalist :
    

    EDIT: Ups! Hab wohl das Problem an der falschen Stelle gesehen! 😕 ...wie peinlich! 😃 Naja, vielleicht kann ja trotzdem wer das Programm gebrauchen.



  • @Gregor: Danke! WOllte schon immer mal einen Thread haben, bei dem alle System-Properties sichtbar sind! 👍


  • Mod

    😃 😃 ...die Suche hätte dir auch weitergeholfen:

    http://www.c-plusplus.net/forum/viewtopic.php?t=37464&highlight=properties

    Interessant, dass das alte Programm praktisch genau dem entspricht, was ich gerade geschrieben habe! ...das kann kein Zufall sein! 😃 😃



  • *ouch* 🙂



  • Also nochmal vielen Dank an alle die mir geholfen haben!

    😃 😃 😃 😃 😃 😃 😃 😃 😃 😃



  • Was macht printkln?


  • Mod

    k-line schrieb:

    Was macht printkln?

    Sag ich nicht! :p



  • Dann reiche ich die Frage mal an Cengiz weiter (der diese Methode auch benutzt hat)


Anmelden zum Antworten