Bug 92024 - "java" wrapper blocks options
Summary: "java" wrapper blocks options
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: jdkgcj
Version: 9
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-05-31 18:28 UTC by Tim Landscheidt
Modified: 2005-10-31 22:00 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-06-02 11:32:31 UTC
Embargoed:


Attachments (Terms of Use)

Description Tim Landscheidt 2003-05-31 18:28:57 UTC
The wrapper shell script /usr/bin/java (jdkgcj 0.2.3-5) blocks options 
"intended" for the java application to be executed. Example: 
 
--- start of HelloWorld.java --- 
class HelloWorldApp 
  { 
    public static void main (String [] args) 
      { 
        System.out.print ("Received arguments: "); 
        for (int i = 0; i < args.length; i++) 
          { 
            if (i > 0) 
              System.out.print (", "); 
            System.out.print (args [i]); 
          } 
        System.out.println (); 
      } 
  } 
--- end of HelloWorld.java --- 
 
After compiling: 
 
| [tim@lockfix /var/tmp]$ java -cp HelloWorldApp.class HelloWorldApp 1 2 3 
| Received arguments: 1, 2, 3 
| [tim@lockfix /var/tmp]$ java -cp HelloWorldApp.class HelloWorldApp 1 -2 3 
| Warning: -2 not understood. Ignoring. 
| Received arguments: 1, 3 
 
This is a show stopper for many applications. 
 
 
Suggested fix: 
 
Hmmm. The whole script is FUBAR and needs a complete rewrite :-). *Maybe*: 
When the *first* unknown option (or any other string, such as the class name) 
is encountered, just call 'gij $params "$@"' (BTW, I *really* dislike the 
temporary file idea ... *brrr*). At a glance, javac may have similar problems.

Comment 1 Tim Landscheidt 2003-05-31 20:00:53 UTC
Speaking of show stoppers, I wanted to cross-reference 
<URI:http://gcc.gnu.org/bugzilla/show_bug.cgi?id=7482> at least once in 
Bugzilla :-). 

Comment 2 Jakub Jelinek 2003-06-02 11:32:31 UTC
jdkgcj has been removed from future distributions.


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