06 February 2005 - java_dev (original) (raw)

Java developers

February 6th, 2005

03:14 pm - jizmunci - help, again, please, go on, you know you want to. how do I read the next line rather than repeatedly read the same line in this part of a loop?: try { FileInputStream empStream = new FileInputStream ("employee.dat"); InputStreamReader inemp = new InputStreamReader(empStream); empReader = new BufferedReader (inemp); line = empReader.readLine(); StringTokenizer A = new StringTokenizer (line); for (i=0; i<2; i++) { em[i]= A.nextToken(); } }
06:23 pm - jizmunci - who fancies being a lifesaver I have made tokens. these tokens are meant to be altered if they are null. this does not seem to work all the time in this loop. Any thoughts why?the tokens have been declared outside the loop as have the strings (that they were assigned to) that you can see here. this is my last significant problem on my first Java lab (due tomorrow). It's frustrating.try { FileOutputStream outStream = new FileOutputStream ("billingReport.txt"); aWriter = new PrintWriter (outStream); if(em[1] == null) { em[1] = "*ERROR* *name missing*"; } if(en[4] == null) { em[1] = ("*ERROR* " + em[1]); en[4] = "*hours missing*"; h = ""; } if(co[1] == null) { em[1] = "*ERROR* " + em[1]; co[1] = "*description missing*"; } if(en[2] == null) { em[1] = "*ERROR* " + em[1]; en[2] = "*entry date missing*"; } aWriter.println (em[1] + " charged " + en[4] + h + " to " + co[1] +" on " + en[2]) ; System.out.println (em[1] + " charged " + en[4] + h + " to " + co[1]+ " on " + en[2]) ; }
09:23 pm - mdweezer - Setting up Eclipse with 1.3.1 SDK Well I was using the 1.5 SDK and Eclipse with no problem. However I had set that up before a class of mine started. We're using a terribly old book and the professor wants us to use the 1.3.1 SDK. So once I got rid of 1.5 and installed 1.3.1 I lost the ability to use Eclipse. I searched and found that Eclipse 2.0 is made for 1.3.1 (I could be wrong) but I downloaded it and i'm still having troubles. When I attempt to open it I get the following:"A Java SDK must be available in order to run Eclipse. No Java virtual machine was found after searching the following locations:c:\eclipse\jre\bin\javaw.exe'javaw.exe' in your current PATH"Can I just copy my bin folder from the SDK and make it work? What would be the steps necessary to add javaw.exe to my path?The SDK is located in C:\jdk1.3.1Thanks a lot.In the meantime i'm using JCreator but I really like Eclipse for the realtime error checking and dot notation.