Solved

problem with java application on windows 98

Posted on 2001-07-10
10
238 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Application launch issue with Apache Tomcat 5 64
ejb wildfly example 2 29
going to wrong jsp page 2 34
Fast way to search item into Java Array (Rhino compatible) 2 31
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
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 learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

821 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