• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

javac path

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
i'm running on windows 2000 and ijust downloiaded jdk 1.2.2 and set the path to c:\jdk1.2.2\bin and i can't run javac from c:\.
Can somebody tell me the reason?
Regards,
Shalini
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Shalini,
Edit your autoexec.bat and add C:\JDK1.2.2\BIN to PATH variable. Reboot the machine. Then you will be able to run the javac and other java executables in the \BIN directory from any other directory.
Ajith
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ajith, i'm running on Windows 2000 and i set the path in user variables and syastem variables but i can't run it.
Shalini
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you reboot your machine after you changed the path? Perhaps you can check if the change has taken effect by going to dos prompt and typing path.
Ajith
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ajith, thanks a lot for your time.
I have rebooted my machine many times and still i can't use javac from any other place.Also, i can complie files but when i run it says
"Exception in Thread main java.lang.NoClassDefFoundError"
Thank you so much........
Shalini
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmmm.. looks like you don't have the CLASSPATH set properly and java.exe doesn't know where to look for .class files. That's why you are getting the ClassDef error.
Perhaps you should read the installation instructions again. Check if you have covered all the steps, including setting up the CLASSPATH. If necessary, just runthrough the list again from step #1.
After you follow all the steps( and reboot the machine if necessary ), just go to the dos prompt and check your path. If that is not being set despite your repeated effort, then you should perhaps contact your sysadmin.
That's all I can think of. Since I work on ( more reliable ) windows NT, I am not aware of nitty-gritty details of Win2000. Perhaps if there are other Win2000 users, they may be able to help you better ..
Good luck,
Ajith

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Shalini!
Can u check ur autoexec.bat contains this path entry like..
PATH %PATH%CLASSPATH=C:\JAVA\LIB\CLASSES.ZIP... so..
try out..
all the best.
Rajan.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have c:\jdk1.2.2\bin in my path in uservariables and system variables.I rebooted my machine many a times and i see that it has c:\jdk1.2.2\bin in the path variable.
But it doesn't work.This ois driving me crazy...
Shalini
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Shalini ,
It is possible that u might not be using right letters for your filename. Java is case-sensitive. So that could be the reason.. cause of compiler is throwing run time exceptions.. the settings should be fine.
 
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Try and see whether this works:
From the command prompt go the folder where your java files are there and type
set path=e:\jdk1.2.2\bin;(or wherever you jdk is installed)
and then type
set classpath=.;%classpath;
And then try to run the program..will this work..i don't know ,but why don't you give it a try.
Surya
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everrybody out there who tried to help me...
i had to include a variable called classpath and give the value as c:\jdk1.2.2\bin and it did work.It didn't understand if i gave it as path.
Thanks a lot for ur help....
Shalini
 
reply
    Bookmark Topic Watch Topic
  • New Topic