Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 153246 - Can not have spaces in vm arguments when using java command
Summary: Can not have spaces in vm arguments when using java command
Alias: None
Product: Fedora
Classification: Fedora
Component: java-1.4.2-gcj-compat
Version: 4
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Thomas Fitzsimmons
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2005-04-03 23:23 UTC by Jeff Myers
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2005-04-15 19:11:37 UTC

Attachments (Terms of Use)
Simple test class (deleted)
2005-04-03 23:23 UTC, Jeff Myers
no flags Details

Description Jeff Myers 2005-04-03 23:23:17 UTC
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 (/usr/local/lib/
Caused by: java.lang.ClassNotFoundException: Bar not found in
parent=gnu.gcj.runtime.VMClassLoader{urls=[core:/], parent=null}}
   at java.lang.ClassLoader.loadClass(java.lang.String, boolean)
   at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader)
   at (/usr/local/lib/

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 23:23:17 UTC
Created attachment 112639 [details]
Simple test class

Comment 2 Jeff Myers 2005-04-03 23:44:55 UTC
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 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 06:55:53 UTC
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 19:11:37 UTC
Fixed in Rawhide.

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