JDK-6937897 : (jli) The "-javaagent" option cannot decode the given path correctly
  • Type: Bug
  • Component: tools
  • Sub-Component: launcher
  • Affected Version: 6u18
  • Priority: P4
  • Status: Closed
  • Resolution: Future Project
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2010-03-24
  • Updated: 2012-05-08
  • Resolved: 2012-05-08
Related Reports
Relates :  
Description
OPERATING SYSTEM
----------------
Windows

FULL JDK VERSION
----------------
java version "1.6.0_18"
Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
Java HotSpot(TM) Client VM (build 16.0-b13, mixed mode, sharing)

DESCRIPTION:
------------
Put an ordinary jar into a folder whose name contains Chinese or Japanese characters, then issue the below command outside of this folder:

    java -javaagent:<folder_name>/xxx.jar

For example:

    C:\>java -javaagent:D:\??test\tree.jar -version
    Error opening zip file or JAR manifest missing : D:\??test\tree.jar
    Error occurred during initialization of VM
    agent library failed to init: instrument

Comments
EVALUATION This is a fairly complicated fix, basically the entire launcher must be made MS's [Wide character] Unicode friendly, the complication is that the most of the launcher code is shared by unix and windows, so this needs to be done very very carefully. ie. provide replaceable macros for all the posix apis, thus they can be switched for Windows (Unicode, Non-unicode) and Unix. The added complexity is that JNI invocation APIs are not Wide character friendly on Windows, either.
08-05-2012

EVALUATION These are related to the fact that the java launcher is not UNICODE friendly.
30-07-2010

EVALUATION This seems to be an issue related to the launcher implementation (JLI library) where may not use the native unicode-aware file access API. When -javaagent is specified, the VM loads instrument.dll that attempts to get the manifest from the given jarfile by calling the JLI_ManifestIterate function. This issue should also apply to the java launcher to launch a jar file with non-ASCII pathname: 6475368 Jar file doesnt execute if the path to it contains cyrilic letters
23-07-2010