This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to take Two files as input

 
Vivekkk Singh
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i want to take two files as input from command prompt


So when i am running it :- java ReadNWrite Input.txt Output.txt
I get an Error
Exception in thread "main" java.lang.NoClassDefFoundError: ReadNWrite/java
Caused by: java.lang.ClassNotFoundException: ReadNWrite.java


Please help!!!
 
shan raj
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks your class ReadNWrite.class not in your class path.. kindly check that..
 
Henry Wong
author
Marshal
Pie
Posts: 21117
78
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vivekkk Singh wrote:
So when i am running it :- java ReadNWrite Input.txt Output.txt
I get an Error
Exception in thread "main" java.lang.NoClassDefFoundError: ReadNWrite/java
Caused by: java.lang.ClassNotFoundException: ReadNWrite.java



It is looking for a class named "java" in the ReadNWrite package. This is generally caused by accidentally using the ".java" extension when running. Perhaps you did this...

java ReadNWrite.java Input.txt Output.txt

Instead of...

java ReadNWrite Input.txt Output.txt


Henry
 
Jeffy Ding
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have a package for this class?

javac ReadWirter.java

java ReadWriter input.txt output.txt
 
Vivekkk Singh
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for all help it was resolved.
 
Campbell Ritchie
Sheriff
Pie
Posts: 48954
60
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And how wass it resolved? Did it really take 15 months?
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:And how wass it resolved? Did it really take 15 months?

15 ?
 
Campbell Ritchie
Sheriff
Pie
Posts: 48954
60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, Joanne, I misread the date. It should read 23.
 
Vivekkk Singh
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
haha No it was resolved same day but i didn't see this post from last 23 months ;) ..

problem was the file was not placed under src .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic