Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Back off jdk 1.5.0_05

Reply
Thread Tools

Back off jdk 1.5.0_05

 
 
Roedy Green
Guest
Posts: n/a
 
      09-20-2005
I have submitted a serious bug on JDK 1.5.0_05. The command line
parser is hosed. Ant does not work. Anything with quotes or
backslashes may stop working. I am retreating to 1.5.0_04.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
 
Reply With Quote
 
 
 
 
Ian Pilcher
Guest
Posts: n/a
 
      09-20-2005
Roedy Green wrote:
> I have submitted a serious bug on JDK 1.5.0_05. The command line
> parser is hosed. Ant does not work. Anything with quotes or
> backslashes may stop working. I am retreating to 1.5.0_04.


Bug #?

--
================================================== ======================
Ian Pilcher http://www.velocityreviews.com/forums/(E-Mail Removed)
================================================== ======================
 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      09-20-2005
On Tue, 20 Sep 2005 20:26:37 GMT, Roedy Green
<(E-Mail Removed)> wrote or quoted :

>I have submitted a serious bug on JDK 1.5.0_05. The command line
>parser is hosed. Ant does not work. Anything with quotes or
>backslashes may stop working. I am retreating to 1.5.0_04.


It turns out the "bug" is a feature that has been in there a while. I
am surprised I have not tripped over it before. Perhaps I have and
never noticed what was hitting me.

details at http://mindprod.com/jgloss/main.html

Will be posted in an hour or so.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      09-20-2005
On Tue, 20 Sep 2005 15:32:39 -0500, Ian Pilcher
<(E-Mail Removed)> wrote or quoted :

>Bug #?


It has only an internal review ID of 538733 at this point. It won't
get one. I now think it is a "feature" - an ugly feature.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
 
Reply With Quote
 
Alex Molochnikov
Guest
Posts: n/a
 
      09-21-2005
I tried this on my Win XP with Java 1.5.0_04:

public class Test
{
public static void main(String[] args)
{
for (int i = 0; i < args.length; i++)
System.out.println("args[" + i + "] = " + args[i]);
}
}

This is the output from the command-line execution:

> java Test " \\Program Files "

args[0] = \\Program Files

(ignore the space between double quote and backslash; my OE client takes
liberty of reformatting text when " is followed by \\. The actual command
does not use spaces.)

> java Test "\Program Files"

args[0] = \Program Files

This syntax also works when the JVM is started programmatically by
Runtime.exec() method.

What happens with this test at your end?

Alex Molochnikov
Gestalt Corporation


"Roedy Green" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On Tue, 20 Sep 2005 20:26:37 GMT, Roedy Green
> <(E-Mail Removed)> wrote or quoted :
>
> >I have submitted a serious bug on JDK 1.5.0_05. The command line
> >parser is hosed. Ant does not work. Anything with quotes or
> >backslashes may stop working. I am retreating to 1.5.0_04.

>
> It turns out the "bug" is a feature that has been in there a while. I
> am surprised I have not tripped over it before. Perhaps I have and
> never noticed what was hitting me.
>
> details at http://mindprod.com/jgloss/main.html
>
> Will be posted in an hour or so.
> --
> Canadian Mind Products, Roedy Green.
> http://mindprod.com Again taking new Java programming contracts.



 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      09-21-2005
On Wed, 21 Sep 2005 02:03:37 GMT, "Alex Molochnikov"
<(E-Mail Removed)> wrote or quoted :

>What happens with this test at your end?


I posted a number of examples at
http://mindprod.com/jgloss/main.html#COMMANDLINE
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
 
Reply With Quote
 
Alex Molochnikov
Guest
Posts: n/a
 
      09-21-2005
I misread the page the first time.

I tried running java as a second-hand process through Runtime.exec(),
passing parameters with backslashes to it, and observed the same effect
(stripping off the tail-end backslashes, so that two become one, and one
becomes none).

For a moment I thought it was a DOS command-line interpretor (cmd) playing
tricks, but it is obviously Java.

Stranger things happened.


"Roedy Green" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On Wed, 21 Sep 2005 02:03:37 GMT, "Alex Molochnikov"
> <(E-Mail Removed)> wrote or quoted :
>
> >What happens with this test at your end?

>
> I posted a number of examples at
> http://mindprod.com/jgloss/main.html#COMMANDLINE
> --
> Canadian Mind Products, Roedy Green.
> http://mindprod.com Again taking new Java programming contracts.



 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      09-21-2005
On Wed, 21 Sep 2005 02:55:42 GMT, "Alex Molochnikov"
<(E-Mail Removed)> wrote or quoted :

>For a moment I thought it was a DOS command-line interpretor (cmd) playing
>tricks, but it is obviously Java.


If you write a DOS program, you get the entire command line in one
great piece. It is up to you to split it into parms.

I assumed that Windows works the the same way, and the application
uses library code to split into bite size parameters. The quotes and
\ stuff has to be done by whatever does that splitting, e.g. the C
runtime or the Java runtime.

I suppose this convention works fine under other oses. It is just
windows where trailing \ are common.

The wanted to make it work the same way on all platforms.

I have always preferred the exec where you use a String[]. It just
seemed more "reliable". Perhaps it somehow helps you avoid this
command line glitch.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
 
Reply With Quote
 
Andrea Desole
Guest
Posts: n/a
 
      09-21-2005
Only one thing: you can also use DISPOSE_ON_CLOSE. See:

http://java.sun.com/j2se/1.5.0/docs/...eadIssues.html
 
Reply With Quote
 
Larry Barowski
Guest
Posts: n/a
 
      09-21-2005

"Roedy Green" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> If you write a DOS program, you get the entire command line in one
> great piece. It is up to you to split it into parms.
>
> I assumed that Windows works the the same way, and the application
> uses library code to split into bite size parameters. The quotes and
> \ stuff has to be done by whatever does that splitting, e.g. the C
> runtime or the Java runtime.
>
> I suppose this convention works fine under other oses. It is just
> windows where trailing \ are common.
>
> The wanted to make it work the same way on all platforms.
>
> I have always preferred the exec where you use a String[]. It just
> seemed more "reliable". Perhaps it somehow helps you avoid this
> command line glitch.


For UNIX/Linux, where multiple command line arguments
are supported at the OS level, this is entirely reliable. For
Windows, it is somewhat more reliable, but there is no
guarantee that the target program will parse command line
arguments the way that Java assumes it will. When I first
learned that Windows only supported one command line
argument, I was appalled.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
JDK 1.5 or JDK 1.6 Pep Java 19 07-15-2007 12:06 AM
regarding JDk 141 and JDK 122 for linux 64 bit Platform Jaggu Java 3 01-08-2007 10:47 AM
What is the difference between J2EE, JDK, JDK-SDK, JRE and J2SE packages ? Ulf Meinhardt Java 0 08-10-2006 07:12 PM
jEdit: compiles JDK 1.5.0 ok, but runs JDK 1.4.1 (why?) Thomas G. Marshall Java 5 08-06-2004 04:12 AM
Help with converting IDS from JDK 1.1 to JDK 1.4 Babar Java 1 05-20-2004 09:11 PM



Advertisments