I use the following in a batch file to set up my environment; works
fine for XP SP1 & SP2.  I never set the System environment variables;
I use a batch file to set up my individual command prompts/consoles.

env.bat:
@echo off

echo.
echo Setting up environment...

@REM
@REM Set any necessary environment variables
@REM
echo.
set JAVA_HOME=C:\Program Files\java\jdk1.5.0_01
set MAVEN_HOME=C:\apache\maven-1.0.2

@REM
@REM Update the path to include the above environment variables
@REM
set PATH=%MAVEN_HOME%\bin;%PATH%
set PATH=%JAVA_HOME%\bin;%PATH%

@REM
@REM Show current environment setup.
@REM
echo  JAVA_HOME=%JAVA_HOME%
echo.
echo  MAVEN_HOME=%MAVEN_HOME%
echo.
echo  PATH=%PATH%


On 7/5/05, Kenney Westerhof <[EMAIL PROTECTED]> wrote:
> On Tue, 5 Jul 2005 [EMAIL PROTECTED] wrote:
> 
> You have to reboot (or maybe log out/log in or kill EXPLORER.exe) to make
> the environment variables visible in the cmd shell (starting a new shell
> doesn't always work).
> 
> You could also always manually set them in the cmd line..
> 
> Btw, I tested the batch file here with long filenames (with spaces) and it
> works fine here - and I guess over there too :)
> 
> 
> 
> > Hi All
> >
> > Problem is solved but I'm not convinced with the solution.
> > Earlier I have set "PATH" variable in "user variables" as
> >
> > PATH=C:\Program Files\Java\jdk1.5.0_03\bin;C:\Program Files\Apache Software 
> > Foundation\maven-2.0-alpha-3\bin;%Path%
> >
> > I got the error as mentioned earlier.
> >
> > Then I tried setting PATH and JAVA_HOME variable in "System Variables", it 
> > works fine.
> >
> > Both the times, I set JAVA_HOME and M2_HOME variable in user variable 
> > section.
> >
> > What could be the problem ?
> >
> > Tarun
> >
> >
> >
> > -----Original Message-----
> > From: Kenney Westerhof [mailto:[EMAIL PROTECTED]
> > Sent: 05 July 2005 13:01
> > To: Maven Users List
> > Subject: Re: AW: M2 Alpha3 on Windows XP
> >
> >
> > On Tue, 5 Jul 2005, Sreenivas Mangasandra wrote:
> >
> >
> > Known problem. Solution:
> >
> > Use the shortnames in the classpath and path.
> >
> > I.e.:
> >
> > 1) JAVA_HOME=C:\PROGRA~1\Java\jdk1.5.0_03
> >
> > 2) 
> > Path=C:\Progra~1\Java\jdk1.5.0_03\bin;C:\PROGRA~1\APACHE~1\maven-2.0-alpha3\bin;%PATH%
> >
> > -- Kenney
> >
> > > Hi Tarun,
> > >
> > > It seems everything is correct. But when maven responds only if it is in 
> > > the
> > > path.
> > >
> > > --> path
> > >
> > > JAVA_HOME has to point to the java directory.
> > >
> > > "C:\maven-2.0-alpha-3\bin" (my folder path) has to be included in the path
> > >
> > > It is possible that you have done this.
> > >
> > > Have you closed the current command prompt window and opened a new one
> > > To check maven --verion. Also check once again path variable whether it
> > > contains the maven bin directory.
> > >
> > > Did u try installing maven 1.0.2 the stable version n check it. To see if
> > > You get the same kind of error.
> > >
> > > Other than that I have no idea.  Do let us know if you solve it.
> > >
> > >
> > > Sreenivas.
> > >
> > >
> > > With Best regards / Mit freundlichen Grüßen
> > >
> > > Sreenivas Mangasandra,
> > >
> > > Intland Software GmbH, Wankel Str. 3,
> > > D-70563 Stuttgart, Germany
> > > Tel.: +49 711 722 1834
> > >
> > >
> > > -----Ursprüngliche Nachricht-----
> > > Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> > > Gesendet: Dienstag, 5. Juli 2005 13:14
> > > An: [email protected]
> > > Betreff: M2 Alpha3 on Windows XP
> > >
> > > Hi All
> > > I'm trying to install maven2 on Windows XP.
> > >
> > > 1)JAVA_HOME=C:\Program Files\Java\jdk1.5.0_03
> > >
> > > 2) Path=C:\Program Files\Java\jdk1.5.0_03\bin;C:\Program Files\Apache
> > > Software Foundation\maven-2.0-alpha-3\bin;%PATH%
> > >
> > > When I tried
> > > m2 --version
> > > Got the error as mention below, What could be the reason ?
> > >
> > > Usage: java [-options] class [args...]
> > >            (to execute a class)
> > >    or  java [-options] -jar jarfile [args...]
> > >            (to execute a jar file)
> > >
> > > where options include:
> > >     -client       to select the "client" VM
> > >     -server       to select the "server" VM
> > >     -hotspot      is a synonym for the "client" VM  [deprecated]
> > >                   The default VM is client.
> > >
> > >     -cp <class search path of directories and zip/jar files>
> > >     -classpath <class search path of directories and zip/jar files>
> > >                   A ; separated list of directories, JAR archives,
> > >                   and ZIP archives to search for class files.
> > >     -D<name>=<value>
> > >                   set a system property
> > >     -verbose[:class|gc|jni]
> > >                   enable verbose output
> > >     -version      print product version and exit
> > >     -version:<value>
> > >                   require the specified version to run
> > >     -showversion  print product version and continue
> > >     -jre-restrict-search | -jre-no-restrict-search
> > >                   include/exclude user private JREs in the version search
> > >     -? -help      print this help message
> > >     -X            print help on non-standard options
> > >     -ea[:<packagename>...|:<classname>]
> > >     -enableassertions[:<packagename>...|:<classname>]
> > >                   enable assertions
> > >     -da[:<packagename>...|:<classname>]
> > >     -disableassertions[:<packagename>...|:<classname>]
> > >                   disable assertions
> > >     -esa | -enablesystemassertions
> > >                   enable system assertions
> > >     -dsa | -disablesystemassertions
> > >                   disable system assertions
> > >     -agentlib:<libname>[=<options>]
> > >                   load native agent library <libname>, e.g. 
> > > -agentlib:hprof
> > >                     see also, -agentlib:jdwp=help and -agentlib:hprof=help
> > >     -agentpath:<pathname>[=<options>]
> > >                   load native agent library by full pathname
> > >     -javaagent:<jarpath>[=<options>]
> > >                   load Java programming language agent, see
> > > java.lang.instrument
> > >
> > > Regards
> > > Tarun Jain
> > >
> > > Visit our website at http://www.ubs.com
> > >
> > > This message contains confidential information and is intended only
> > > for the individual named.  If you are not the named addressee you
> > > should not disseminate, distribute or copy this e-mail.  Please
> > > notify the sender immediately by e-mail if you have received this
> > > e-mail by mistake and delete this e-mail from your system.
> > >
> > > E-mail transmission cannot be guaranteed to be secure or error-free
> > > as information could be intercepted, corrupted, lost, destroyed,
> > > arrive late or incomplete, or contain viruses.  The sender therefore
> > > does not accept liability for any errors or omissions in the contents
> > > of this message which arise as a result of e-mail transmission.  If
> > > verification is required please request a hard-copy version.  This
> > > message is provided for informational purposes and should not be
> > > construed as a solicitation or offer to buy or sell any securities or
> > > related financial instruments.
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> > --
> > Kenney Westerhof
> > http://www.neonics.com
> > GPG public key: http://www.gods.nl/~forge/kenneyw.key
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> > Visit our website at http://www.ubs.com
> >
> > This message contains confidential information and is intended only
> > for the individual named.  If you are not the named addressee you
> > should not disseminate, distribute or copy this e-mail.  Please
> > notify the sender immediately by e-mail if you have received this
> > e-mail by mistake and delete this e-mail from your system.
> >
> > E-mail transmission cannot be guaranteed to be secure or error-free
> > as information could be intercepted, corrupted, lost, destroyed,
> > arrive late or incomplete, or contain viruses.  The sender therefore
> > does not accept liability for any errors or omissions in the contents
> > of this message which arise as a result of e-mail transmission.  If
> > verification is required please request a hard-copy version.  This
> > message is provided for informational purposes and should not be
> > construed as a solicitation or offer to buy or sell any securities or
> > related financial instruments.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> --
> Kenney Westerhof
> http://www.neonics.com
> GPG public key: http://www.gods.nl/~forge/kenneyw.key
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
Jamie Bisotti
Software Engineer
Lexmark International, Inc.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to