Solved

problem with java application on windows 98

Posted on 2001-07-10
10
229 Views
Last Modified: 2008-02-01
my operating system is windows 98.
i have a java application, which i launch using a batch file.
in the batch file, i set both the path and classpath variables in order to run my java application.
i have 2 problems with this. although my java application is launched and it works,
1. an ms-dos application (with an icon the same as the command prompt) is created, which works basically the same as my batch file
2. there is a "too many parameter" message on the command prompt
3. the command prompt does not close after i close my application..

can anybody help me with this?
0
Comment
Question by:happymae
  • 5
  • 2
  • 2
  • +1
10 Comments
 
LVL 92

Expert Comment

by:objects
ID: 6271846
1. Try launching your app with javaw instead of java
2. Need to see your batch file
3. Sounds like the app doesn't exit on close, do u have the code?
0
 

Author Comment

by:happymae
ID: 6271876
1. same thing happens even with javaw. a PIF file is created btw..
2. for the "too many parameters" error, i read somewhere that i should set my path in the autoexec.bat.. with that, this is my batch file

-------------
@echo off
c:
cd \AddBook\chgpw
set path=C:\Program Files\IBM\Java12\jre\bin;%path%;
set classpath=c:\AddBook\Chgpw\password.jar;C:\Program Files\IBM\Java12\jre\lib\rt.jar;%classpath%;
java Password
exit
-------------

but if i don't set the path variable in my autoexec.bat, this is the batch file
-------------
@echo off
c:
cd \AddBook\chgpw
set classpath=c:\AddBook\Chgpw\password.jar;C:\Program Files\IBM\Java12\jre\lib\rt.jar;%classpath%;
java Password
exit
-------------

3. works fine with windows 2000.. unfortunately, i dont have the code..
0
 

Expert Comment

by:AlokSinha
ID: 6271918
in the begining of your batch file just add this lines:

command /e:2048

what this does is to set the initial environment size to 2048 bytes(you can choose any other value, by default its set to 128 bytes)
I think this should solve your problem of "too many parameter" .

The other part of the problem can be solved by modifying your application(changing the method which handles your window close event);
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

by:happymae
ID: 6271932
"in the begining of your batch file just add this lines:
command /e:2048"

i tried that, but what happened is that a command prompt opens, the following appears:
--------------------
c:\AddBook\ChgPW>

c:\AddBook\ChgPW>command /e:2048

Microsoft(R) Windows 98
   (C)Copyright Microsoft Corp 1981-1999

c:\AddBook\ChgPW>
---------------------

nothing happens after this..



0
 

Expert Comment

by:AlokSinha
ID: 6271968
then try this:
open a command window and type

command /e:2048

then run your batch file(the original one).

0
 

Author Comment

by:happymae
ID: 6271998
same thing..
wait, my windows 98 is jap version by the way..
but it has no relation to this problem whatsoever, does it?
0
 
LVL 3

Accepted Solution

by:
dnoelpp earned 80 total points
ID: 6272311
This whole thing seems to be a collection of different, not very related problems.

1. "too many parameters" seems to be a dos prompt memory problem. So the suggestions of AlokSinha go in the right direction, but they fail because of minor problems like typos. Just experiment a little with the /e parameter of command.exe. An alternative solution would be to change config.sys and give the dos prompt more memory for the parameters. Or use NT/2000, they don't know such problems with the dos prompt.

2. Dos window: Usually each Java application has a console. The console is the place for the standard out- and input. Windows doesn't manage consoles very well (compared to unix), so there is a need for two different java launchers: java.exe and javaw.exe. The latter doesn't open a console window, so you can't use standard output and input [System.out.println() doesn't work] without redirecting.

3. Dos window doesn't close: This can depend on the configuration of the link. One of the configuration options is something like "Close Window after exit".
Of course the problem could be, too, that your Java program doesn't exit correctly when the window was closed.

*** SUMMARY ***

This is a very vague "solution", because the problems are very vague, too. My hint is: Try to solve all problems stepwise. First try to solve the "too many parameters" problem, etc. Take time and recheck often!

Good luck!
0
 
LVL 92

Expert Comment

by:objects
ID: 6272342
Move all your jar files into your ext directory (located inside the lib directory in your java installation), you can then get rid of the need for your classpath.

Please explain 1 & 3 in more detail as it sounds like we're misunderstanding you.
If you run the command from the commandline (no batch file) does the DOS window popup.
And in 3. are you saying that the extra popped up dos window does not go away?


0
 

Author Comment

by:happymae
ID: 6272404
i also did some research, and i have solved problems 2 and 3..
1. actually, it's a PIF file that is created. and, it seems that there's nothing i can do about it.
2. "too many parameters". i just changed this
set path=C:\Program Files\IBM\Java12\jre\bin;%path%;
to
set path="C:\Program Files\IBM\Java12\jre\bin;%path%;"
cannot understand why it worked, but it did.
3. in the properties of the batch file, under the programs tab, i just checked "close window after program ends" (or something like that since my OS is jap)..

my final batch file looks like this:
-------
@echo off
c:
cd \AddBook\chgpw
set path="C:\Program Files\IBM\Java12\jre\bin;%path%";
set classpath=c:\AddBook\Chgpw\password.jar;C:\Program Files\IBM\Java12\jre\lib\rt.jar;%classpath%;
javaw Password
exit
------

to answer object, yes, with my original batch file, my command prompt window does not close even after i close my java application (seems like i have to edit the batch file's properties)

dnoelpp, you're right about nt/2000. i never had these problems..

so, with my pif file and new batch file, everything is now ok.. i really cannot understand how i got it to work, but im not going to question that anymore. all that matters is that it's now working ;)

thanks to everyone who helped.. i hope someday, someone who will have the same problem will find this useful.

0
 

Author Comment

by:happymae
ID: 6272405
i also did some research, and i have solved problems 2 and 3..
1. actually, it's a PIF file that is created. and, it seems that there's nothing i can do about it.
2. "too many parameters". i just changed this
set path=C:\Program Files\IBM\Java12\jre\bin;%path%;
to
set path="C:\Program Files\IBM\Java12\jre\bin;%path%;"
cannot understand why it worked, but it did.
3. in the properties of the batch file, under the programs tab, i just checked "close window after program ends" (or something like that since my OS is jap)..

my final batch file looks like this:
-------
@echo off
c:
cd \AddBook\chgpw
set path="C:\Program Files\IBM\Java12\jre\bin;%path%";
set classpath=c:\AddBook\Chgpw\password.jar;C:\Program Files\IBM\Java12\jre\lib\rt.jar;%classpath%;
javaw Password
exit
------

to answer object, yes, with my original batch file, my command prompt window does not close even after i close my java application (seems like i have to edit the batch file's properties)

dnoelpp, you're right about nt/2000. i never had these problems..

so, with my pif file and new batch file, everything is now ok.. i really cannot understand how i got it to work, but im not going to question that anymore. all that matters is that it's now working ;)

thanks to everyone who helped.. i hope someday, someone who will have the same problem will find this useful.

0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question