Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

chapter 10 question

 
Janki Shah
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I compile .java file using below line how do I run it?


directory structure for this is, myProject/source/MyClass.java. Here, all .class files are stored in folder name classes. So, all .class file will be stored in myProject/classes/ path. To run this .class file, is there any other way except going in to classes folder to run them? like this c:\myPoject\classes>java MyClass
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
say to the java where your class file stays using -cp after your java command
 
Janki Shah
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Seetharaman.
like this, java -cp classes MyClass
Seetharaman Venkatasamy wrote:say to the java where your class file stays using -cp after your java command
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Janki Shah wrote:Thank you Seetharaman.

hope you got... you are welcome
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic