Results 1 to 2 of 2
- 10-11-2012, 12:41 PM #1
Member
- Join Date
- Oct 2012
- Posts
- 2
- Rep Power
- 0
Program that must accept input redirection
Hello all
I've been using Java for a while now but this is the first instance I've had dealing with input redirection and I'm at point where I don't know what to do, I can't seem to find much information on how to achieve this and no tutors or lecturers are replying to my emails ( obviously they don't know either
). I have a program that should read in some input and then from that, construct an adjacency list for an undirected graph. I've got the program working to the point where if I run it, copy and paste the contents of a small .txt file and enter it, the desired output is shown. So the program works. However, I have to submit it into my university's auto marker which runs the file through a command line. The auto marker uses java graphs1 < test.txt as its input to the program. If I open up command prompt and attempt to do the same, I get the error message saying "Exception in thread "main" java.lang.NoClassDefFoundError: graphs1 (wrong name: A4/graphs1)."
My program accepts input like so
What should I be changing or doing differently to get the command line method to work? Any hints or tips?Java Code:public static void main(String[] args) throws IOException{ try{ BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); while(input != null){ GraphAdjMatrix gAM = new GraphAdjMatrix(input); uGraphLists uG = new uGraphLists(gAM); System.out.print(uG); } input.close(); } catch(NumberFormatException e){ } }
Any help is greatly appreciated.
- 10-11-2012, 02:13 PM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Similar Threads
-
Security alert doesn't accept user input?
By DLpres in forum New To JavaReplies: 4Last Post: 02-03-2012, 06:57 AM -
speech redirection from one app to other; changing input from mic to socket
By johnyjj2 in forum New To JavaReplies: 0Last Post: 12-11-2009, 11:29 PM -
Input redirection in Java
By freephoneid in forum Advanced JavaReplies: 6Last Post: 05-08-2009, 03:20 AM -
redirection
By prashant in forum NetworkingReplies: 1Last Post: 02-25-2009, 02:53 PM -
redirection in jsp
By valery in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 08-06-2007, 08:31 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks