Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Java Autoexec.bat help 2

Status
Not open for further replies.

superman3

Programmer
May 19, 2001
7
0
0
US
I'm trying to set the path in my autoexec.bat file and I thought I did it correctly, but I reset my computer 2 times and it's still not finding javac. I have a copy of the autoexec.bat file below after inserting the directory where the compiler is located. If someone could tell me what I can do to make this work, I'd appreciate it.
Thanks

REM To make a DOS Boot Diskette; See the file C:\DOSBOOT\DOSBOOT.TXT

@echo off
C:\PROGRA~1\NETWOR~1\MCAFEE~1\SCANPM.EXE C:smartdrv c+
@if errorlevel 1 pause

SET PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\USER\COMPR;C:\USER\DN;
C:\MSSQL7\BIN;C:\PROGRA~1\BORLAND\DELPHI4\BIN;C:\JAVA1-2\BIN /*this is where my javac compiler is located */


SET PATH=C:\IBMVJava\eab\bin;C:\BC5\BIN;%PATH%
IF EXIST C:\IMNNQ_95\IMNENV.BAT CALL C:\IMNNQ_95\IMNENV.BAT
SET BLASTER=A220 I5 D1 T2

SET CLASSPATH=C:\IBMVJava\eab\runtime20;C:\PROGRA~1\BORLAND\VBROKER\lib\vbcpp.jar
SET CLASSPATH=.;C:\JFactory11;%CLASSPATH%
SET IMNINST=help
SET IMNINSTSRV=C:\IMNNQ_95
SET PATH=%PATH%;C:\IMNNQ_95
PATH=C:\BC45\BIN;%PATH%
PATH=%PATH%;C:\JAVA1-2\BIN

mode con rate=31 delay=1
REM - By Windows Setup - Set NWLANGUAGE=ENGLISH
 
Try typing
Code:
path
in a command prompt to see what the path really looks like. Is it correct (means: does c:\java1-2\bin show up twice, once in the middle and once in the end)?

Then you can try to collate the different statements that expand the path in a single one to set the path at once. Looks pretty ugly right now, I think ;-), and is also error-prone. %PATH% is the DOS-Variable that holds the path and can be used in Batches - so if you just get all paths from all those lines that start with
Code:
path=
and separate them by ; that should work fine and look nicer.
Besides: There you can also look if you really do need all these paths set and still use the programs (a little cleaning up...)

I hope the /**/ does not stand in the real autoexec.bat? Yust for double-checking - the comment in a Batch is introduced by rem (for remark) at the start of a line.

I think you already checked if the path is not c:\java1.2\bin? Try to reach the directory in the command promt to double-check this...

Hope this helps...
 
Hi,

Maybe you would like to try this instead of 'SET PATH=%PATH%;C:\JAVA1-2\BIN':-

SET PATH=C:\JAVA1-2\BIN;%PATH%

Hope this helps,
Leon If you need additional help, you can email to me at zaoliang@hotmail.com I don't guaranty that I will be able to solve your problems but I will try my best :)
 
hi superman3,

I got the same problems, but when I type the set path and set classpath, in the dos prompt it work fine, but the problem is the you must type it, each time you reboot you compter.


 
As superman3 said, you have to put the set statements into autoexec.bat - this Batch is executed every time you start your PC. If you use Win2k you'll have to right-click on "My Computer", select Properties, Advanced and set it in the environment variables. Don't know how to do it in NT4 though...

Hope this helps allow thyself to be the spark that lights the fire
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top