aspose file tools
The moose likes Java in General and the fly likes How to take Two files as input Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "How to take Two files as input" Watch "How to take Two files as input" New topic
Author

How to take Two files as input

Vivekkk Singh
Greenhorn

Joined: Feb 20, 2009
Posts: 16
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

Joined: Dec 16, 2008
Posts: 42
It looks your class ReadNWrite.class not in your class path.. kindly check that..
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 16695
    
  19

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


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Jeffy Ding
Greenhorn

Joined: Sep 22, 2008
Posts: 1
Do you have a package for this class?

javac ReadWirter.java

java ReadWriter input.txt output.txt


If you want you can.
Vivekkk Singh
Greenhorn

Joined: Feb 20, 2009
Posts: 16
thanks for all help it was resolved.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32708
    
    4
And how wass it resolved? Did it really take 15 months?
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3011
    
    9
Campbell Ritchie wrote:And how wass it resolved? Did it really take 15 months?

15 ?


Joanne
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32708
    
    4
Thank you, Joanne, I misread the date. It should read 23.
Vivekkk Singh
Greenhorn

Joined: Feb 20, 2009
Posts: 16
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 .
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: How to take Two files as input
 
Similar Threads
Input/Output Problem
IO
How to use jave to do remote ftp, download, upload stuff ?
problem with writing file , please help
Hi All