Your message dated Wed, 17 Aug 2011 14:48:24 +0200
with message-id <[email protected]>
and subject line Re: Bug#629398: sun-java6-jre: Incorrect working directory 
[System.getProperty("user.dir")] when "open with java 6 runtime
has caused the Debian Bug report #629398,
regarding sun-java6-jre: Incorrect working directory 
[System.getProperty("user.dir")] when "open with java 6 runtime
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
629398: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=629398
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: sun-java6-jre
Version: 6.25-3
Severity: important

There's probably problem with workig directory [System.getProperty("user.dir")]
when trying to run *.jar (eg abc_program.jar) by opening via "Sun java 6
Runtime"
 (the same with OpenJDK).

System.getProperty("user.dir") return user home directory istead current work
dir.

Problem doesn't exist when application is launching via console eg.:
java -jar abc_program.jar




-- System Information:
Debian Release: 6.0.1
  APT prefers proposed-updates
  APT policy: (500, 'proposed-updates'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-686 (SMP w/4 CPU cores)
Locale: LANG=pl_PL.UTF-8, LC_CTYPE=pl_PL.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages sun-java6-jre depends on:
ii  debconf [debconf-2.0]         1.5.36.1   Debian configuration management sy
ii  java-common                   0.40       Base of all Java packages
ii  locales                       2.11.2-10  Embedded GNU C Library: National L
ii  sun-java6-bin                 6.25-3     Sun Java(TM) Runtime Environment (

Versions of packages sun-java6-jre recommends:
ii  gsfonts-x11                   0.21       Make Ghostscript fonts available t

Versions of packages sun-java6-jre suggests:
pn  sun-java6-fonts           <none>         (no description available)
ii  sun-java6-plugin          6.25-3         Java(TM) Plug-in, Java SE 6
pn  ttf-arphic-uming          <none>         (no description available)
pn  ttf-kochi-gothic | ttf-sa <none>         (no description available)
pn  ttf-kochi-mincho | ttf-sa <none>         (no description available)
ii  ttf-unfonts-core          1.0.2-080608-3 Un series Korean TrueType fonts

-- debconf information:
* shared/accepted-sun-dlj-v1-1: true
  sun-java6-jre/stopthread: true
  sun-java6-jre/jcepolicy:
* shared/error-sun-dlj-v1-1:
* shared/present-sun-dlj-v1-1:



--- End Message ---
--- Begin Message ---
On 2011-08-17 12:38, Marcin wrote:
> Well, your method's working.
> 
> but according to:
> http://download.oracle.com/javase/6/docs/api/java/lang/System.html#getProperties()
> "user.dir    User's [b]current working directory[/b]  " - I'd expect that to
> point to "properly" current working dir path all the time:/
> 

It does point to the "current working dir"; but I suspect you are
confusing "current working dir" with the "location of the binary
executed".  These are two separate things[1].
  C-programs can (usually) determine their "location" by examining the
argv[0] element, but Java programs do not have this option (as java does
not reveal it to the Main method).


> Anyway, thanks for your help,
> If it's not a bug good to know there's a trap like that
> 
> Marcin
> 
> [...]

I am afraid it is "standard practice".  :)  I am closing this as "not a
bug".

~Niels

[1] Although I cannot find a good source on it.  If you are interested
the following might give you a bit of insight in the issue:

http://stackoverflow.com/questions/143174/c-c-how-to-obtain-the-full-path-of-current-directory



--- End Message ---

Reply via email to