Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > comp.lang.java.programmer > #4945

Re: How to create a batch file for Java Console Application?

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!news-transit.tcx.org.uk!tr22g12.aset.psu.edu!news.glorb.com!postnews.google.com!34g2000pru.googlegroups.com!not-for-mail
From Mozart <publicrelationschief@gmail.com>
Newsgroups comp.lang.java.programmer
Subject Re: How to create a batch file for Java Console Application?
Date Fri, 3 Jun 2011 10:53:41 -0700 (PDT)
Organization http://groups.google.com
Lines 68
Message-ID <7a22b030-1ca3-44ff-b680-831d5fb4ff4e@34g2000pru.googlegroups.com> (permalink)
References <4e647693-974d-424a-b2c0-f12c6d519b93@22g2000prx.googlegroups.com> <8969fa6f-d569-4eae-adec-473edb8713a4@a9g2000prl.googlegroups.com> <dJadnd01CZeyVC7QnZ2dnUVZ_oudnZ2d@earthlink.com> <ob6dnZF-Ebd82inQnZ2dnUVZ_r6dnZ2d@posted.palinacquisition>
NNTP-Posting-Host 98.247.66.195
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
X-Trace posting.google.com 1307123622 14879 127.0.0.1 (3 Jun 2011 17:53:42 GMT)
X-Complaints-To groups-abuse@google.com
NNTP-Posting-Date Fri, 3 Jun 2011 17:53:42 +0000 (UTC)
Complaints-To groups-abuse@google.com
Injection-Info 34g2000pru.googlegroups.com; posting-host=98.247.66.195; posting-account=c31yaQoAAAD8z5E4nTrfezbzt70nDGs0
User-Agent G2/1.0
X-Google-Web-Client true
X-Google-Header-Order HUALESNKRC
X-HTTP-UserAgent Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.17) Gecko/20110420 Firefox/3.6.17 ( .NET CLR 3.5.30729),gzip(gfe)
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:4945

Show key headers only | View raw


On Apr 24, 8:55 am, Peter Duniho <NpOeStPe...@NnOwSlPiAnMk.com> wrote:
> On 4/23/11 11:54 PM, Patricia Shanahan wrote:
>
> > On 4/23/2011 8:37 PM, buddy s wrote:
> >> [...]
> >> you need to first set your classpath in .bat file and then your need
> >> to invoke your application using "java" command you can get more
> >> information about classpath here
> >>http://javarevisited.blogspot.com/2011/01/how-classpath-work-in-java....
>
> > Why do you consider setting the classpath variable preferable to using
> > the java -cp parameter?
>
> Can't answer for "buddy s", but I think -cp is clearly superior.
>
> But if someone really wanted to set the CLASSPATH environment variable
> in a Windows .bat batch file, they can easily do so without affecting
> other Java programs as long as the batch file itself runs only the one
> Java program and either a) the batch file itself is run in a non-shared
> environment (e.g. by double-clicking a link to the batch file itself,
> which will create a new console window just for that batch file), or b)
> including the "setlocal" statement at the beginning of the batch file,
> so that any changes to the environment are not preserved once the batch
> file ends.
>
> Pete

Thanks for all the feedback.

OK, maybe I can get a little simpler advice.  I do not have that much
experience in Java programming and I was more active in this project
on the
C++ end.  I appreciate the technical discussion but it's on a level a
few levels more abstract than creating a practical solution.  The
average user I find cannot be trusted to know much about anything and
so install routines need to be brainless.  I have had a lot of
professional
experience with average end users and their needs.  Most of them are
not technically
inclined.

Right not I have a Java console application
that needs to be decompressed from a zip file.  I imagine
that they can see the folder at this point after they have
personally decompressed this file.
I can give them instructions like this:

"One has to keep double clicking on the folders you see until
one finds the folder that says Resources. In this
folder there will be a program that says Contents.
In that folder, ones clicks on the JParaMindAndDictStd.bat
file and the program launches without any problem."

Can someone think of a solution easy for me to program as an essential
Java newbie that will help a newcomer not have to navigate a lot
of hidden folders?

This is the current path structure of the batch file:

java -cp c:\ParaMind Windows64-1.1\JParaMind.app\Contents\Resources
\Java\JParaMindAndDict.jar JParaMind

How could I make the path more of a global variable that would work on
anyone's machine?


Back to comp.lang.java.programmer | Previous | NextNext in thread | Find similar


Thread

Re: How to create a batch file for Java Console Application? Mozart <publicrelationschief@gmail.com> - 2011-06-03 10:53 -0700
  Re: How to create a batch file for Java Console Application? Roedy Green <see_website@mindprod.com.invalid> - 2011-06-05 15:16 -0700

csiph-web