Bug 153246 - Can not have spaces in vm arguments when using java command
Can not have spaces in vm arguments when using java command
Product: Fedora
Classification: Fedora
Component: java-1.4.2-gcj-compat (Show other bugs)
All Linux
medium Severity high
: ---
: ---
Assigned To: Thomas Fitzsimmons
Depends On:
  Show dependency treegraph
Reported: 2005-04-03 19:23 EDT by Jeff Myers
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-04-15 15:11:37 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Simple test class (148 bytes, text/plain)
2005-04-03 19:23 EDT, Jeff Myers
no flags Details

  None (edit)
Description Jeff Myers 2005-04-03 19:23:17 EDT
Description of problem:
The java-gcj-compat java wrapper does not pass vm arguments with spaces
(surrounded by quotes) to gij properly.  It appears like the quotes are stripped
causing launching problems with gij.

Version-Release number of selected component (if applicable):

How reproducible:
Every time.

Steps to Reproduce:
1. For a given java app SimpleTest.class
2. try launching App using the command:
3. java -DmyArg="Foo Bar" SimpleTest
Actual results:

[jeff@venture dev]$ /usr/lib/jvm/java-1.4.2-gcj-
-DmyArg="Foo Bar" SimpleTest
Exception in thread "main" java.lang.NoClassDefFoundError: Bar
   at gnu.java.lang.MainThread.run() (/usr/local/lib/libgcj.so.6.0.0)
Caused by: java.lang.ClassNotFoundException: Bar not found in
parent=gnu.gcj.runtime.VMClassLoader{urls=[core:/], parent=null}}
   at java.net.URLClassLoader.findClass(java.lang.String)
   at java.lang.ClassLoader.loadClass(java.lang.String, boolean)
   at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader)
   at gnu.java.lang.MainThread.run() (/usr/local/lib/libgcj.so.6.0.0)

Expected results:
SimpleTest should run properly, with the system property myArg set to "Foo Bar".

Additional info:
I compiled java-gcj-compat-1.0.19 myself rather than installing from rpm, so
it's quite possible that I've screwed something up.  Please let me know if this
is reproducible.
Comment 1 Jeff Myers 2005-04-03 19:23:17 EDT
Created attachment 112639 [details]
Simple test class
Comment 2 Jeff Myers 2005-04-03 19:44:55 EDT
It looks like FC4 Test 1 is using the package
whereas FC3 used the working version

Comparing these two, it appears the problematic line in java.in in version
40jpp_7rh is line 47:
vm_params="$vm_params $1"

In version 11jpp, the equivalent (working) line is 32:
params="$params \"`echo $1 |sed -e 's,",\\\\",g'`\""
Comment 3 Thomas Fitzsimmons 2005-04-04 02:55:53 EDT
I committed a patch to gcc CVS Friday that makes gij command-line compatible
with the java command.  When that patch lands in the Rawhide gcc rpms we'll be
able to remove this wrapper script and symlink java directly to gij.
Comment 4 Thomas Fitzsimmons 2005-04-15 15:11:37 EDT
Fixed in Rawhide.

Note You need to log in before you can comment on or make changes to this bug.