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
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: java-1.4.2-gcj-compat
Version: 4
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
Assignee: Thomas Fitzsimmons
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
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:
Clone Of:
Environment:
Last Closed: 2005-04-15 19:11:37 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Simple test class (148 bytes, text/plain)
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):
java-1.4.2-gcj-compat-1.4.2.0-40jpp_7rh
java-gcj-compat-1.0.19

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-1.4.2.0/jre/bin/java
-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
gnu.gcj.runtime.SystemClassLoader{urls=[],
parent=gnu.gcj.runtime.VMClassLoader{urls=[core:/], parent=null}}
   at java.net.URLClassLoader.findClass(java.lang.String)
(/usr/local/lib/libgcj.so.6.0.0)
   at java.lang.ClassLoader.loadClass(java.lang.String, boolean)
(/usr/local/lib/libgcj.so.6.0.0)
   at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader)
(/usr/local/lib/libgcj.so.6.0.0)
   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 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
java-1.4.2-gcj-compat-1.4.2.0-40jpp_7rh
whereas FC3 used the working version
java-1.4.2-gcj-compat-1.4.2.0-11jpp

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 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.