Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (9.5k points)

System-Specs:

Kubuntu 9.04

Gnome 2.2.61

Java 1.5.0_16

Below is my test case:

$ more Test.java

class Test { public static void main( String[] args ) { System.out.println( System.getProperties() ); } }

This is the result I got:

$ javac Test.java

$ java Test

{

java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition,

sun.boot.library.path=/home/MYCOMPANY/myname/apps/jdk1.5.0_16/jre/lib/i386,

java.vm.version=1.5.0_16-b02,

java.vm.vendor=Sun Microsystems Inc.,

java.vendor.url=http://java.sun.com/,

path.separator=:,

java.vm.name=Java HotSpot(TM) Server VM,

file.encoding.pkg=sun.io,

sun.java.launcher=SUN_STANDARD,

user.country=US,

sun.os.patch.level=unknown,

java.vm.specification.name=Java Virtual Machine Specification,

user.dir=/home/MYCOMPANY/myname/temp,

java.runtime.version=1.5.0_16-b02,

java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment,

java.endorsed.dirs=/home/MYCOMPANY/myname/apps/jdk1.5.0_16/jre/lib/endorsed,

os.arch=i386,

java.io.tmpdir=/tmp,

line.separator=

,

java.vm.specification.vendor=Sun Microsystems Inc.,

os.name=Linux,

sun.jnu.encoding=UTF-8,

java.library.path=/home/MYCOMPANY/myname/apps/jdk1.5.0_16/jre/lib/i386/server:/home/MYCOMPANY/myname/apps/jdk1.5.0_16/jre/lib/i386:/home/MYCOMPANY/myname/apps/jdk1.5.0_16/jre/../lib/i386,

java.specification.name=Java Platform API Specification,

java.class.version=49.0,

sun.management.compiler=HotSpot Server Compiler,

os.version=2.6.28-15-generic,

user.home=?,

user.timezone=,

java.awt.printerjob=sun.print.PSPrinterJob,

file.encoding=UTF-8,

java.specification.version=1.5,

java.class.path=.,

user.name=?,

java.vm.specification.version=1.0,

java.home=/home/MYCOMPANY/myname/apps/jdk1.5.0_16/jre,

sun.arch.data.model=32,

user.language=en,

java.specification.vendor=Sun Microsystems Inc.,

java.vm.info=mixed mode,

java.version=1.5.0_16,

java.ext.dirs=/home/MYCOMPANY/myname/apps/jdk1.5.0_16/jre/lib/ext,

sun.boot.class.path=/home/MYCOMPANY/myname/apps/jdk1.5.0_16/jre/lib/rt.jar:/home/MYCOMPANY/myname/apps/jdk1.5.0_16/jre/lib/i18n.jar:/home/MYCOMPANY/myname/apps/jdk1.5.0_16/jre/lib/sunrsasign.jar:/home/MYCOMPANY/myname/apps/jdk1.5.0_16/jre/lib/jsse.jar:/home/MYCOMPANY/myname/apps/jdk1.5.0_16/jre/lib/jce.jar:/home/MYCOMPANY/myname/apps/jdk1.5.0_16/jre/lib/charsets.jar:/home/MYCOMPANY/myname/apps/jdk1.5.0_16/jre/classes,

java.vendor=Sun Microsystems Inc.,

file.separator=/,

java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi,

sun.io.unicode.encoding=UnicodeLittle,

sun.cpu.endian=little,

sun.desktop=gnome,

sun.cpu.isalist=

}

Can anyone tell me where Java looks to find the user and home directory and why the System.getProperty("user.home") and System.getProperty("user.name") returns a question mark "?".

1 Answer

0 votes
by (19.7k points)

The simple solution to this is you have to use 64-bit JDK on a 64-bit system. 

Interested in Java? Check out this Java Certification by Intellipaat.

Related questions

0 votes
1 answer
asked May 6, 2021 in Java by sheela_singh (9.5k points)
0 votes
1 answer
asked Feb 12, 2021 in Java by sheela_singh (9.5k points)
0 votes
1 answer
0 votes
1 answer
asked Apr 3, 2021 in Java by dante07 (13.1k points)

Browse Categories

...