Solved

problem with java application on windows 98

Posted on 2001-07-10
10
243 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
spring jars download 1 68
Need Help! Getting a syntax error and don't understand why 3 55
Java array sort 10 62
Java pass by reference 3 74
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
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…
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…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

739 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