• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help in understanding classpath

 
rohan yadav
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone, I am quite stuck at setting classpath in windoxs xp.
I want some information on how set CLASSPATH?
Also i didnt understand last chapter of k&b(Development), if anyone have additional information about it please help
 
Ankur kothari
Ranch Hand
Posts: 531
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what didnt you understand?
 
rohan yadav
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using eclipse for running my java program, so i have no knowledge of CLASSPATH. I am finding very difficult to run program from command prompt. So i want to understand this
 
rohan yadav
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didnt understand page no 762 from k&b book(javac command and its directory structure)
 
Ankur kothari
Ranch Hand
Posts: 531
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
are you available on gtalk or skype so that i can help you ? because answering can be quite painful
 
Ankur kothari
Ranch Hand
Posts: 531
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
762 or 792? which book do you have? java 6 study guide right....?exam 310-065
 
rohan yadav
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi please help in understaing classpath
 
Ankur kothari
Ranch Hand
Posts: 531
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


i have added you though
 
avi sinha
Ranch Hand
Posts: 453
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ankur kothari wrote:are you available on gtalk or skype so that i can help you ? because answering can be quite painful


i didn't understand why this is going to be painful and how the pain can be reduced using gmail or skype ???

avi sinha
 
Ankit Garg
Sheriff
Posts: 9519
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have a rule on javaranch where we encourage people to UseTheForumNotEmail . If you explain anything on forum, then many other people will also be benefited from it. I personally never had any problem answering a question on the forum. Just giving a decent explanation accompanied by any tutorial link can solve even a very complex problem...
 
Ankur kothari
Ranch Hand
Posts: 531
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
actually i am explaining himeverything related to compiling java filesfrom command promt and setting his environment variables
 
avi sinha
Ranch Hand
Posts: 453
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ankur kothari wrote:actually i am explaining himeverything related to compiling java filesfrom command promt and setting his environment variables


that's right but it can be done here too and in fact it will help others too who are having problems in this particular topic as well as related ones.

avi sinha
 
Ankur kothari
Ranch Hand
Posts: 531
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you want i cant paste the whole chat here
 
Ankur kothari
Ranch Hand
Posts: 531
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i will type the relevant extract here.....many people use netbeans or eclipse...this will help them change to command prompt
 
rohan yadav
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is not like that we are it hiding it from other users on the forum but since it will take long process to understand hence we switched to gtalk.
 
Punit Singh
Ranch Hand
Posts: 952
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And by the way, if you people go in wrong direction in classpath concept, we can catch your ears here. How will we know what you are discussing on your gmail. How will we pull your legs?
 
Ankur kothari
Ranch Hand
Posts: 531
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dont worry...everything is going great here..
 
avi sinha
Ranch Hand
Posts: 453
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ankur kothari wrote:if you want i cant paste the whole chat here


there is no need of that my friend. we are not saying that you are having a private chat and we have some problem regarding that. our point is to make discussions here so that it can help others too. it looked like stealing a topic here which is not a good practice.may be somebody else is having the same problem and is expecting an explanation from you and others.just think about that.

avi sinha
 
Ankur kothari
Ranch Hand
Posts: 531
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i know what you mean my friend...actually i had got the same error which gave me headaches...so i wanted to help him...sorry for stealing him away(i seem to be getting in controversies lately)
 
rohan yadav
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry to take conversation in gtalk, we will take necessary steps onward
Sorry those have hurt/
 
Ankit Garg
Sheriff
Posts: 9519
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anyone is free to discuss anything privately, we can't stop you from doing that. If a person named A starts a topic and says, "hey this is my problem and this is my mail id, explain me on my email id" we strongly discourage that. First of all sharing your email id publicly is an invitation to spams. Secondly, its like the person asking the question doesn't wants others to learn, he/she just wants to learn himself/herself. Also if you discuss publicly, there are more chances that if anyone describing the problem makes a mistake, anyone else can point that out. Also suppose if a person B actually sends a response to person A about the problem, and if person A has a followup question, person A is kinda stuck with person B about the question. Only person B knows what he/she wrote to person A. So in a lot of ways its better to discuss things publicly. Also there are a lot of tutorials on the internet which explains classpath etc very good. Sun's site also has a very in depth tutorial on everything java...
 
Punit Singh
Ranch Hand
Posts: 952
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I myself used to assume that I am very good in classpath, never felt any problem in classpath compilation and running, but if you see one yr old post, there is a very long debate on classpath concept, and it came out a great learning for me, as I was going in the wrong direction but I was discussing it in public. If I had done that in private, sure I would have missed some part of classpath.
 
rohan yadav
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its not that we dont want to share things publicly but its a long process and i have to start it from scratch so we moved to gtalk.
 
rohan yadav
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey sorry to everyone, can you tell me the useful links for understanding CLASSPATH
 
Ankit Garg
Sheriff
Posts: 9519
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
rohan yadav wrote:Its not that we dont want to share things publicly but its a long process and i have to start it from scratch so we moved to gtalk.

As I said earlier, whether you discuss anything publicly or privately that's your choice. But sometimes its disadvantageous to discuss something privately as your private talk is with a single person. The level of knowledge of that person might be limited. Even if he/she knows everything, still he/she might forget to tell you a few things. If you discuss something publicly, lets take your classpath example, then others are free to join the conversation. Others might ask a few questions on your topic which you didn't think about. That way even you'll learn better...
 
Ankit Garg
Sheriff
Posts: 9519
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
 
rohan yadav
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So ankit i didnt undestand how to use command like javac -d ../classes com/myClass.java.
I using eclipse previously, so i havnt learned these concepts.
 
Punit Singh
Ranch Hand
Posts: 952
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Hey both links are really great.
 
rohan yadav
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Both link are very good.
 
Punit Singh
Ranch Hand
Posts: 952
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
rohan yadav wrote:So ankit i didnt undestand how to use command like javac -d ../classes com/myClass.java.
I using eclipse previously, so i havnt learned these concepts.


javac : means compile please

-d : means your destination for .class file is

../classes : one up than classes folder (destination)

com/myClass.java : and your source file is here in current directory, there is com folder inside that myClass.java is source file.
 
Ankit Garg
Sheriff
Posts: 9519
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
-d is used to specify the destination of your generated class files (as Punit already said). -cp or -classpath is used to specify the classpath...
 
rohan yadav
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
got it sir
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic