• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Setting Classpath

 
chandana kotamraju
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to java.Everytime I am seting the path=c:\jdk1.2.2\bin before compiling.But I am facing problems when I tried to do a swing program.I know that it has something to do with classpath.Can anyone help me by writing in detail how to do it.
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Chandana,
You seem to be getting confused with terminology. Your title talks about ClassPath and your topic only mentions Path. There are 2 different paths in question here.
The Path variable you have set seems correct. It is only used in compilation. If your code compiles (with or without errors) then your Path is correct.
The ClassPath variable should at least be set to "." if you plan to run any program from the directory where it resides.
If you are running WinNT:
Goto MyComputer and right click,
Choose properties (last menu item)
Select the Environment Tab
If no CLASSPATH variable exists:
Type in CLASSPATH in the Variable textfield
Type in .; in the Value textfield
If a CLASSPATH does exist:
Make sure it has a single dot(".") in it (between
2 semi-colons).
Click Ok button on bottom of Window.
You should now be able to go to the directory where your *.java file exists, compile it, and run it without any problems.
Regards,
Manfred.
 
chandana kotamraju
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Win98 . Advice me on seting the class path in Win98.
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Chandana,
I don't understand your problem. I am running under Win98 at home and I have never needed to do anything with the class path. You should only have to set it if you have many *.class files that are scattered all around your directories.
When you write basic programs, don't place a package line in it. This will allow you to have all you *.class files in a single directory. Then you just have to CD to that directory and compile and run.
If you are still having problems, you will have better luck explaining what your problem is so if can be fixed. Talking in generalities get us no where ...
Regards,
Manfred.
 
Tina Parks
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had a different take on his question. I thought by his question that he is having trouble configuring his browser to run Swing. No?
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am moving this thread to the Beginners forum.
Please continue the discussion there.
regds.
- satya
 
SoonAnn Lim
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you can set your classpath variable in your autoexec.bat file. Once you reboot the system, all the environmental variables will be initialized appropriately.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic