• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to take Two files as input

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!!!
 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It looks your class ReadNWrite.class not in your class path.. kindly check that..
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for all help it was resolved.
 
Marshal
Posts: 79239
377
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And how wass it resolved? Did it really take 15 months?
 
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:And how wass it resolved? Did it really take 15 months?


15 ?
 
Campbell Ritchie
Marshal
Posts: 79239
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 .
 
reply
    Bookmark Topic Watch Topic
  • New Topic