Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


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

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

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!goblin1!goblin.stu.neva.ru!postnews.google.com!news1.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.posted.palinacquisition!news.posted.palinacquisition.POSTED!not-for-mail
NNTP-Posting-Date Sun, 24 Apr 2011 10:55:13 -0500
Date Sun, 24 Apr 2011 08:55:11 -0700
From Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com>
User-Agent Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9
MIME-Version 1.0
Newsgroups comp.lang.java.programmer
Subject Re: How to create a batch file for Java Console Application?
References <4e647693-974d-424a-b2c0-f12c6d519b93@22g2000prx.googlegroups.com> <8969fa6f-d569-4eae-adec-473edb8713a4@a9g2000prl.googlegroups.com> <dJadnd01CZeyVC7QnZ2dnUVZ_oudnZ2d@earthlink.com>
In-Reply-To <dJadnd01CZeyVC7QnZ2dnUVZ_oudnZ2d@earthlink.com>
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
Message-ID <ob6dnZF-Ebd82inQnZ2dnUVZ_r6dnZ2d@posted.palinacquisition> (permalink)
Lines 24
X-Usenet-Provider http://www.giganews.com
NNTP-Posting-Host 50.46.118.188
X-Trace sv3-RZkDNLLhumP/mbGAAWLhyrhlL/NLOLI4Gt8rhlzyEWirQDWY+s2A1G7YL+sQiVzcMATmt8YsRgKEW/r!KPGDARxPGQwQxf3Y5zYjhnzPpe5VzU/7r01oNKi6WKvQTDdLch2NwD1S6mtimGCINcGc4Gf1zo72!YVdSjc1JsFGpnnuzGe8HLUe28gufL8rg8NYsGPgyQZ0=
X-Complaints-To abuse@iinet.com
X-DMCA-Complaints-To abuse@iinet.com
X-Abuse-and-DMCA-Info Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info Otherwise we will be unable to process your complaint properly
X-Postfilter 1.3.40
X-Original-Bytes 2611
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:3240

Show key headers only | View raw


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.html
>
> 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

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


Thread

How to create a batch file for Java Console Application? Mozart <publicrelationschief@gmail.com> - 2011-04-23 12:34 -0700
  Re: How to create a batch file for Java Console Application? rossum <rossum48@coldmail.com> - 2011-04-23 23:37 +0100
  Re: How to create a batch file for Java Console Application? Lew <noone@lewscanon.com> - 2011-04-23 18:37 -0400
  Re: How to create a batch file for Java Console Application? Roedy Green <see_website@mindprod.com.invalid> - 2011-04-23 18:37 -0700
  Re: How to create a batch file for Java Console Application? buddy s <savingfunda@gmail.com> - 2011-04-23 20:37 -0700
    Re: How to create a batch file for Java Console Application? Patricia Shanahan <pats@acm.org> - 2011-04-23 23:54 -0700
      Re: How to create a batch file for Java Console Application? Roedy Green <see_website@mindprod.com.invalid> - 2011-04-24 01:53 -0700
        Re: How to create a batch file for Java Console Application? Patricia Shanahan <pats@acm.org> - 2011-04-24 07:00 -0700
      Re: How to create a batch file for Java Console Application? Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-04-24 08:55 -0700

csiph-web