I cant seem to find the problem with this program I am building as a learning exercise. I am getting errors referenced to extremely simple pieces of code. In the output the first thing that should be printed is the random double number that the program selects then it should print the int conversion of that number. Then it should print the word that was selected from a file and the number of words in the file(29).
Also is there a more efficient way to count the words in a file? If so how?
Here is the code:
note: Line numbers are matched correctly
import java.util.Scanner;
import java.io.File;
public class HangmanFile33 {
public static void main(String[] args) throws Exception {
Scanner input = new Scanner(System.in);
Scanner inputEa = new Scanner(new File("9_33Easy.txt"));
Scanner inputMe = new Scanner(new File("9_33Medium.txt"));
Scanner inputHa = new Scanner(new File("9_33Hard.txt"));
Scanner inputEx = new Scanner(new File("9_33Extreme.txt"));
String word;
System.out.println("Press 0 to exit \nor \nEnter a Difficulty, Easy(1) Medium(2) Hard(3) or Extreme(4): ");
int Diff = input.nextInt();
if(Diff == '0')
System.exit(0);
else if(Diff == '1') {
word = PickWord(inputEa);
}
else if(Diff == '2') {
word = PickWord(inputMe);
}
else if(Diff == '3') {
word = PickWord(inputHa);
}
else if(Diff == '4') {
word = PickWord(inputEx);
}
else {
System.out.println("Invalid Difficulity. \n Please try again.");
}
}
public static String PickWord(Scanner s){
String word;
double randomDouble = Math.random() * CountWords(s);
System.out.println(randomDouble);
int randomInt = (int)randomDouble;
System.out.println(randomInt);
for(int i = 0; i < randomInt; i++) {
s.next();
}
word = s.next();
System.out.println(word);
System.out.println(CountWords(s));
return word;
}
public static int CountWords(Scanner s) {
int wordCount = 0;
while(s.hasNext()) {
s.next();
wordCount++;
}
return wordCount;
}
}
And here is the run of the program:
Press 0 to exit
or
Enter a Difficulty, Easy(1) Medium(2) Hard(3) or Extreme(4):
1
Exception in thread "main" java.util.NoSuchElementException
54
at java.util.Scanner.skip(Scanner.java:1706)
at java.util.Scanner.skip(Scanner.java:1723)
at ProgrammingExcercises.Ch09.HangmanFile33.PickWord(HangmanFile33.java:53)
at ProgrammingExcercises.Ch09.HangmanFile33.main(HangmanFile33.java:32)
Java Result: 1
BUILD SUCCESSFUL (total time: 4 seconds)
And here is the program run in debug mode:
Adding reference: ant.PropertyHelper
Detected Java version: 1.6 in: C:\Program Files (x86)\Java\jdk1.6.0_20\jre
Detected OS: Windows Vista
Adding reference: ant.ComponentHelper
Trying to override old definition of task java
+Datatype java org.apache.tools.ant.module.bridge.impl.ForkedJavaOverride
parsing buildfile jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9/java/ant/nblib/org-netbeans-modules-ant-browsetask.jar!/org/netbeans/modules/ant/browsetask/antlib.xml with URI = jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9/java/ant/nblib/org-netbeans-modules-ant-browsetask.jar!/org/netbeans/modules/ant/browsetask/antlib.xml from a zip file
parsing buildfile jar:file:/C:/Users/Justin%20VanDeBrake/.netbeans/6.9/ant/lib/ant.jar!/org/apache/tools/ant/antlib.xml with URI = jar:file:/C:/Users/Justin%20VanDeBrake/.netbeans/6.9/ant/lib/ant.jar!/org/apache/tools/ant/antlib.xml from a zip file
+Datatype nbbrowse org.netbeans.modules.ant.browsetask.NbBrowse
parsing buildfile jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9/java/ant/nblib/org-netbeans-modules-ant-browsetask.jar!/org/netbeans/modules/ant/browsetask/antlib.xml with URI = jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9/java/ant/nblib/org-netbeans-modules-ant-browsetask.jar!/org/netbeans/modules/ant/browsetask/antlib.xml from a zip file
+Datatype antlib:org.netbeans.modules.ant.browsetask:nbbrowse org.netbeans.modules.ant.browsetask.NbBrowse
parsing buildfile jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9/enterprise/ant/nblib/org-netbeans-modules-web-client-javascript-debugger-ant.jar!/org/netbeans/modules/web/client/javascript/debugger/ant/antlib.xml with URI = jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9/enterprise/ant/nblib/org-netbeans-modules-web-client-javascript-debugger-ant.jar!/org/netbeans/modules/web/client/javascript/debugger/ant/antlib.xml from a zip file
+Datatype nbjsdebugstart org.netbeans.modules.web.client.javascript.debugger.ant.NbJsDebugStart
parsing buildfile jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9/enterprise/ant/nblib/org-netbeans-modules-web-client-javascript-debugger-ant.jar!/org/netbeans/modules/web/client/javascript/debugger/ant/antlib.xml with URI = jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9/enterprise/ant/nblib/org-netbeans-modules-web-client-javascript-debugger-ant.jar!/org/netbeans/modules/web/client/javascript/debugger/ant/antlib.xml from a zip file
+Datatype antlib:org.netbeans.modules.web.client.javascript.debugger.ant:nbjsdebugstart org.netbeans.modules.web.client.javascript.debugger.ant.NbJsDebugStart
parsing buildfile jar:file:/C:/Users/Justin%20VanDeBrake/.netbeans/6.9/ant/nblib/org-netbeans-modules-profiler.jar!/org/netbeans/modules/profiler/antlib.xml with URI = jar:file:/C:/Users/Justin%20VanDeBrake/.netbeans/6.9/ant/nblib/org-netbeans-modules-profiler.jar!/org/netbeans/modules/profiler/antlib.xml from a zip file
+Datatype nbprofileattach org.netbeans.modules.profiler.ant.NBProfileAttachTask
+Datatype nbprofiledirect org.netbeans.modules.profiler.ant.NBProfileDirectTask
parsing buildfile jar:file:/C:/Users/Justin%20VanDeBrake/.netbeans/6.9/ant/nblib/org-netbeans-modules-profiler.jar!/org/netbeans/modules/profiler/antlib.xml with URI = jar:file:/C:/Users/Justin%20VanDeBrake/.netbeans/6.9/ant/nblib/org-netbeans-modules-profiler.jar!/org/netbeans/modules/profiler/antlib.xml from a zip file
+Datatype antlib:org.netbeans.modules.profiler:nbprofileattach org.netbeans.modules.profiler.ant.NBProfileAttachTask
+Datatype antlib:org.netbeans.modules.profiler:nbprofiledirect org.netbeans.modules.profiler.ant.NBProfileDirectTask
parsing buildfile jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9/apisupport/ant/nblib/org-netbeans-modules-apisupport-ant.jar!/org/netbeans/modules/apisupport/ant/antlib.xml with URI = jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9/apisupport/ant/nblib/org-netbeans-modules-apisupport-ant.jar!/org/netbeans/modules/apisupport/ant/antlib.xml from a zip file
+Datatype nbinstaller org.netbeans.modules.apisupport.ant.InstallModuleTask
parsing buildfile jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9/apisupport/ant/nblib/org-netbeans-modules-apisupport-ant.jar!/org/netbeans/modules/apisupport/ant/antlib.xml with URI = jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9/apisupport/ant/nblib/org-netbeans-modules-apisupport-ant.jar!/org/netbeans/modules/apisupport/ant/antlib.xml from a zip file
+Datatype antlib:org.netbeans.modules.apisupport.ant:nbinstaller org.netbeans.modules.apisupport.ant.InstallModuleTask
parsing buildfile jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9/mobility/ant/nblib/org-netbeans-modules-mobility-project-ant.jar!/org/netbeans/modules/mobility/project/ant/antlib.xml with URI = jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9/mobility/ant/nblib/org-netbeans-modules-mobility-project-ant.jar!/org/netbeans/modules/mobility/project/ant/antlib.xml from a zip file
+Datatype nb-mobility-debug org.netbeans.modules.mobility.project.ant.KdpDebugTask
parsing buildfile jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9/mobility/ant/nblib/org-netbeans-modules-mobility-project-ant.jar!/org/netbeans/modules/mobility/project/ant/antlib.xml with URI = jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9/mobility/ant/nblib/org-netbeans-modules-mobility-project-ant.jar!/org/netbeans/modules/mobility/project/ant/antlib.xml from a zip file
+Datatype antlib:org.netbeans.modules.mobility.project.ant:nb-mobility-debug org.netbeans.modules.mobility.project.ant.KdpDebugTask
parsing buildfile jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9/mobility/ant/nblib/org-netbeans-modules-deployment-wm.jar!/org/netbeans/modules/deployment/wm/antlib.xml with URI = jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9/mobility/ant/nblib/org-netbeans-modules-deployment-wm.jar!/org/netbeans/modules/deployment/wm/antlib.xml from a zip file
+Datatype wmDeploy org.netbeans.modules.deployment.wm.WindowsMobileDeployTask
parsing buildfile jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9/mobility/ant/nblib/org-netbeans-modules-deployment-wm.jar!/org/netbeans/modules/deployment/wm/antlib.xml with URI = jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9/mobility/ant/nblib/org-netbeans-modules-deployment-wm.jar!/org/netbeans/modules/deployment/wm/antlib.xml from a zip file
+Datatype antlib:org.netbeans.modules.deployment.wm:wmDeploy org.netbeans.modules.deployment.wm.WindowsMobileDeployTask
parsing buildfile jar:file:/C:/Users/Justin%20VanDeBrake/.netbeans/6.9/ant/nblib/org-netbeans-modules-loadgenerator.jar!/org/netbeans/modules/loadgenerator/antlib.xml with URI = jar:file:/C:/Users/Justin%20VanDeBrake/.netbeans/6.9/ant/nblib/org-netbeans-modules-loadgenerator.jar!/org/netbeans/modules/loadgenerator/antlib.xml from a zip file
+Datatype loadgenstart org.netbeans.modules.loadgenerator.ant.StartLoadgenTask
parsing buildfile jar:file:/C:/Users/Justin%20VanDeBrake/.netbeans/6.9/ant/nblib/org-netbeans-modules-loadgenerator.jar!/org/netbeans/modules/loadgenerator/antlib.xml with URI = jar:file:/C:/Users/Justin%20VanDeBrake/.netbeans/6.9/ant/nblib/org-netbeans-modules-loadgenerator.jar!/org/netbeans/modules/loadgenerator/antlib.xml from a zip file
+Datatype antlib:org.netbeans.modules.loadgenerator:loadgenstart org.netbeans.modules.loadgenerator.ant.StartLoadgenTask
parsing buildfile jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9/java/ant/nblib/org-netbeans-modules-debugger-jpda-ant.jar!/org/netbeans/modules/debugger/jpda/ant/antlib.xml with URI = jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9/java/ant/nblib/org-netbeans-modules-debugger-jpda-ant.jar!/org/netbeans/modules/debugger/jpda/ant/antlib.xml from a zip file
+Datatype nbjpdaconnect org.netbeans.modules.debugger.jpda.ant.JPDAConnect
+Datatype nbjpdastart org.netbeans.modules.debugger.jpda.ant.JPDAStart
+Datatype sourcepath org.netbeans.modules.debugger.jpda.ant.JPDAStart$Sourcepath
+Datatype nbjpdareload org.netbeans.modules.debugger.jpda.ant.JPDAReload
+Datatype nbjpdaappreloaded org.netbeans.modules.debugger.jpda.ant.JPDAAppReloaded
parsing buildfile jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9/java/ant/nblib/org-netbeans-modules-debugger-jpda-ant.jar!/org/netbeans/modules/debugger/jpda/ant/antlib.xml with URI = jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9/java/ant/nblib/org-netbeans-modules-debugger-jpda-ant.jar!/org/netbeans/modules/debugger/jpda/ant/antlib.xml from a zip file
+Datatype antlib:org.netbeans.modules.debugger.jpda.ant:nbjpdaconnect org.netbeans.modules.debugger.jpda.ant.JPDAConnect
+Datatype antlib:org.netbeans.modules.debugger.jpda.ant:nbjpdastart org.netbeans.modules.debugger.jpda.ant.JPDAStart
+Datatype antlib:org.netbeans.modules.debugger.jpda.ant:sourcepath org.netbeans.modules.debugger.jpda.ant.JPDAStart$Sourcepath
+Datatype antlib:org.netbeans.modules.debugger.jpda.ant:nbjpdareload org.netbeans.modules.debugger.jpda.ant.JPDAReload
+Datatype antlib:org.netbeans.modules.debugger.jpda.ant:nbjpdaappreloaded org.netbeans.modules.debugger.jpda.ant.JPDAAppReloaded
parsing buildfile jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9/enterprise/ant/nblib/org-netbeans-modules-j2ee-ant.jar!/org/netbeans/modules/j2ee/ant/antlib.xml with URI = jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9/enterprise/ant/nblib/org-netbeans-modules-j2ee-ant.jar!/org/netbeans/modules/j2ee/ant/antlib.xml from a zip file
+Datatype nbdeploy org.netbeans.modules.j2ee.ant.Deploy
+Datatype nbundeploy org.netbeans.modules.j2ee.ant.Undeploy
+Datatype nbverify org.netbeans.modules.j2ee.ant.Verify
+Datatype nbstartserver org.netbeans.modules.j2ee.ant.StartServer
+Datatype nbstartprofiledserver org.netbeans.modules.j2ee.ant.StartProfiledServer
parsing buildfile jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9/enterprise/ant/nblib/org-netbeans-modules-j2ee-ant.jar!/org/netbeans/modules/j2ee/ant/antlib.xml with URI = jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9/enterprise/ant/nblib/org-netbeans-modules-j2ee-ant.jar!/org/netbeans/modules/j2ee/ant/antlib.xml from a zip file
+Datatype antlib:org.netbeans.modules.j2ee.ant:nbdeploy org.netbeans.modules.j2ee.ant.Deploy
+Datatype antlib:org.netbeans.modules.j2ee.ant:nbundeploy org.netbeans.modules.j2ee.ant.Undeploy
+Datatype antlib:org.netbeans.modules.j2ee.ant:nbverify org.netbeans.modules.j2ee.ant.Verify
+Datatype antlib:org.netbeans.modules.j2ee.ant:nbstartserver org.netbeans.modules.j2ee.ant.StartServer
+Datatype antlib:org.netbeans.modules.j2ee.ant:nbstartprofiledserver org.netbeans.modules.j2ee.ant.StartProfiledServer
parsing buildfile jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9/java/ant/nblib/org-netbeans-modules-javawebstart.jar!/org/netbeans/modules/javawebstart/antlib.xml with URI = jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9/java/ant/nblib/org-netbeans-modules-javawebstart.jar!/org/netbeans/modules/javawebstart/antlib.xml from a zip file
+Datatype jnlpsignjars org.netbeans.modules.javawebstart.SignJarsTask
parsing buildfile jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9/java/ant/nblib/org-netbeans-modules-javawebstart.jar!/org/netbeans/modules/javawebstart/antlib.xml with URI = jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9/java/ant/nblib/org-netbeans-modules-javawebstart.jar!/org/netbeans/modules/javawebstart/antlib.xml from a zip file
+Datatype antlib:org.netbeans.modules.javawebstart:jnlpsignjars org.netbeans.modules.javawebstart.SignJarsTask
parsing buildfile jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9/java/ant/nblib/org-netbeans-modules-java-source-ant.jar!/org/netbeans/modules/java/source/ant/antlib.xml with URI = jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9/java/ant/nblib/org-netbeans-modules-java-source-ant.jar!/org/netbeans/modules/java/source/ant/antlib.xml from a zip file
Trying to override old definition of task javac
+Datatype javac org.netbeans.modules.java.source.ant.JavacTask
+Datatype translate-classpath org.netbeans.modules.java.source.ant.TranslateClassPath
parsing buildfile jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9/java/ant/nblib/org-netbeans-modules-java-source-ant.jar!/org/netbeans/modules/java/source/ant/antlib.xml with URI = jar:file:/C:/Program%20Files%20(x86)/NetBeans%206.9/java/ant/nblib/org-netbeans-modules-java-source-ant.jar!/org/netbeans/modules/java/source/ant/antlib.xml from a zip file
+Datatype antlib:org.netbeans.modules.java.source.ant:javac org.netbeans.modules.java.source.ant.JavacTask
+Datatype antlib:org.netbeans.modules.java.source.ant:translate-classpath org.netbeans.modules.java.source.ant.TranslateClassPath
Setting ro project property: ant.file -> C:\Users\Justin VanDeBrake\.netbeans\6.9\var\cache\executor-snippets\run.xml
Setting ro project property: ant.version -> Apache Ant version 1.8.1 compiled on April 30 2010
Setting ro project property: ant.home -> C:\Users\Justin VanDeBrake\.netbeans\6.9\ant
Setting ro project property: platform.java -> C:\Program Files (x86)\Java\jdk1.6.0_20\bin\java.exe
Setting ro project property: run.jvmargs ->
Setting ro project property: platform.bootcp -> C:\Program Files (x86)\Java\jdk1.6.0_20\jre\lib\resources.jar;C:\Program Files (x86)\Java\jdk1.6.0_20\jre\lib\rt.jar;C:\Program Files (x86)\Java\jdk1.6.0_20\jre\lib\sunrsasign.jar;C:\Program Files (x86)\Java\jdk1.6.0_20\jre\lib\jsse.jar;C:\Program Files (x86)\Java\jdk1.6.0_20\jre\lib\jce.jar;C:\Program Files (x86)\Java\jdk1.6.0_20\jre\lib\charsets.jar;C:\Program Files (x86)\Java\jdk1.6.0_20\jre\classes;C:\Program Files (x86)\Java\jdk1.6.0_20\jre\lib\ext\dnsns.jar;C:\Program Files (x86)\Java\jdk1.6.0_20\jre\lib\ext\localedata.jar;C:\Program Files (x86)\Java\jdk1.6.0_20\jre\lib\ext\sunjce_provider.jar;C:\Program Files (x86)\Java\jdk1.6.0_20\jre\lib\ext\sunmscapi.jar;C:\Program Files (x86)\Java\jdk1.6.0_20\jre\lib\ext\sunpkcs11.jar
Setting ro project property: classname -> ProgrammingExcercises.Ch09.HangmanFile33
Setting ro project property: encoding -> UTF-8
Setting ro project property: build.compiler.emacs -> true
Setting ro project property: classpath -> C:\Program Files (x86)\NetBeans 6.9\enterprise\modules\ext\javaee-api-6.0.jar;C:\Program Files\sges-v3\javadb\lib\derby.jar;C:\Program Files\sges-v3\javadb\lib\derbyclient.jar;C:\Program Files\sges-v3\javadb\lib\derbynet.jar;C:\Program Files\sges-v3\glassfish\modules\bean-validator.jar;C:\Program Files\sges-v3\glassfish\modules\jsf-impl.jar;C:\Program Files\sges-v3\glassfish\modules\javax.security.auth.message.jar;C:\Program Files\sges-v3\glassfish\modules\endorsed\webservices-api-osgi.jar;C:\Program Files\sges-v3\glassfish\modules\endorsed\jaxb-api-osgi.jar;C:\Program Files\sges-v3\glassfish\modules\javax.servlet.jsp.jar;C:\Program Files\sges-v3\glassfish\modules\jsr311-api.jar;C:\Program Files\sges-v3\glassfish\modules\javax.security.jacc.jar;C:\Program Files\sges-v3\glassfish\modules\jsf-api.jar;C:\Program Files\sges-v3\glassfish\modules\jstl-impl.jar;C:\Program Files\sges-v3\glassfish\modules\javax.management.j2ee.jar;C:\Program Files\sges-v3\glassfish\modules\endorsed\javax.annotation.jar;C:\Program Files\sges-v3\glassfish\modules\javax.persistence.jar;C:\Program Files\sges-v3\glassfish\modules\javax.transaction.jar;C:\Program Files\sges-v3\glassfish\modules\javax.enterprise.deploy.jar;C:\Program Files\sges-v3\glassfish\modules\javax.jms.jar;C:\Program Files\sges-v3\glassfish\modules\weld-osgi-bundle.jar;C:\Program Files\sges-v3\glassfish\modules\javax.ejb.jar;C:\Program Files\sges-v3\glassfish\modules\javax.resource.jar;C:\Program Files\sges-v3\glassfish\modules\mail.jar;C:\Program Files\sges-v3\glassfish\modules\javax.servlet.jsp.jstl.jar;C:\Program Files\sges-v3\glassfish\modules\javax.servlet.jar;C:\Program Files\sges-v3\glassfish\modules\web-core.jar;C:\Program Files (x86)\NetBeans 6.9\enterprise\modules\ext\javaee6-endorsed\javax.annotation.jar;C:\Program Files (x86)\NetBeans 6.9\enterprise\modules\ext\javaee6-endorsed\jaxb-api-osgi.jar;C:\Program Files (x86)\NetBeans 6.9\enterprise\modules\ext\javaee6-endorsed\webservices-api-osgi.jar;C:\Program Files (x86)\NetBeans 6.9\mobility\modules\ext\cdc-agui-swing-layout.jar;C:\Program Files (x86)\NetBeans 6.9\mobility\ant\nblib\org-netbeans-modules-j2me-cdc-project-nsicom.jar;C:\Java_lib\Java 3d lib\j3d-1_5_2-windows-amd64\j3d-1_5_2-windows-amd64\j3d-jre\lib\ext\j3dcore.jar;C:\Java_lib\Java 3d lib\j3d-1_5_2-windows-amd64\j3d-1_5_2-windows-amd64\j3d-jre\lib\ext\j3dutils.jar;C:\Java_lib\Java 3d lib\j3d-1_5_2-windows-amd64\j3d-1_5_2-windows-amd64\j3d-jre\lib\ext\vecmath.jar;C:\Java_lib\Java 3d lib\joalmixer-1_5_2\joalmixer-1_5_2\joalmixer.jar;C:\Program Files (x86)\NetBeans 6.9\java\modules\ext\javac-api-nb-7.0-b07.jar;C:\Program Files (x86)\NetBeans 6.9\mobility\modules\ext\cdc-pp-awt-layout.jar;C:\Program Files (x86)\NetBeans 6.9\mobility\modules\org-netbeans-modules-mobility-antext.jar;C:\Program Files (x86)\NetBeans 6.9\java\modules\org-netbeans-modules-classfile.jar;C:\Program Files (x86)\NetBeans 6.9\enterprise\modules\ext\javaee-web-api-6.0.jar;C:\Users\Justin VanDeBrake\Documents\NetBeansProjects\Intro to Java\build\classes
Setting ro project property: work.dir -> C:\Users\Justin VanDeBrake\Documents\NetBeansProjects\Intro to Java
Adding reference: ant.projectHelper
Adding reference: ant.parsing.context
Adding reference: ant.targets
parsing buildfile C:\Users\Justin VanDeBrake\.netbeans\6.9\var\cache\executor-snippets\run.xml with URI = file:/C:/Users/Justin%20VanDeBrake/.netbeans/6.9/var/cache/executor-snippets/run.xml
Setting ro project property: ant.project.name -> {0} (run)
Adding reference: {0} (run)
Setting ro project property: ant.project.default-target -> run
Setting ro project property: ant.file.{0} (run) -> C:\Users\Justin VanDeBrake\.netbeans\6.9\var\cache\executor-snippets\run.xml
Setting ro project property: ant.file.type.{0} (run) -> file
Project base dir set to: C:\Users\Justin VanDeBrake\.netbeans\6.9\var\cache\executor-snippets
+Target:
+Target: run
Adding reference: ant.LocalProperties
Setting ro project property: ant.project.invoked-targets -> run
Attempting to create object of type org.apache.tools.ant.helper.DefaultExecutor
Adding reference: ant.executor
Build sequence for target(s) `run' is [run]
Complete build sequence is [run, ]
run:
Setting project property: classpath-translated -> C:\Program Files (x86)\NetBeans 6.9\enterprise\modules\ext\javaee-api-6.0.jar;C:\Program Files\sges-v3\javadb\lib\derby.jar;C:\Program Files\sges-v3\javadb\lib\derbyclient.jar;C:\Program Files\sges-v3\javadb\lib\derbynet.jar;C:\Program Files\sges-v3\glassfish\modules\bean-validator.jar;C:\Program Files\sges-v3\glassfish\modules\jsf-impl.jar;C:\Program Files\sges-v3\glassfish\modules\javax.security.auth.message.jar;C:\Program Files\sges-v3\glassfish\modules\endorsed\webservices-api-osgi.jar;C:\Program Files\sges-v3\glassfish\modules\endorsed\jaxb-api-osgi.jar;C:\Program Files\sges-v3\glassfish\modules\javax.servlet.jsp.jar;C:\Program Files\sges-v3\glassfish\modules\jsr311-api.jar;C:\Program Files\sges-v3\glassfish\modules\javax.security.jacc.jar;C:\Program Files\sges-v3\glassfish\modules\jsf-api.jar;C:\Program Files\sges-v3\glassfish\modules\jstl-impl.jar;C:\Program Files\sges-v3\glassfish\modules\javax.management.j2ee.jar;C:\Program Files\sges-v3\glassfish\modules\endorsed\javax.annotation.jar;C:\Program Files\sges-v3\glassfish\modules\javax.persistence.jar;C:\Program Files\sges-v3\glassfish\modules\javax.transaction.jar;C:\Program Files\sges-v3\glassfish\modules\javax.enterprise.deploy.jar;C:\Program Files\sges-v3\glassfish\modules\javax.jms.jar;C:\Program Files\sges-v3\glassfish\modules\weld-osgi-bundle.jar;C:\Program Files\sges-v3\glassfish\modules\javax.ejb.jar;C:\Program Files\sges-v3\glassfish\modules\javax.resource.jar;C:\Program Files\sges-v3\glassfish\modules\mail.jar;C:\Program Files\sges-v3\glassfish\modules\javax.servlet.jsp.jstl.jar;C:\Program Files\sges-v3\glassfish\modules\javax.servlet.jar;C:\Program Files\sges-v3\glassfish\modules\web-core.jar;C:\Program Files (x86)\NetBeans 6.9\enterprise\modules\ext\javaee6-endorsed\javax.annotation.jar;C:\Program Files (x86)\NetBeans 6.9\enterprise\modules\ext\javaee6-endorsed\jaxb-api-osgi.jar;C:\Program Files (x86)\NetBeans 6.9\enterprise\modules\ext\javaee6-endorsed\webservices-api-osgi.jar;C:\Program Files (x86)\NetBeans 6.9\mobility\modules\ext\cdc-agui-swing-layout.jar;C:\Program Files (x86)\NetBeans 6.9\mobility\ant\nblib\org-netbeans-modules-j2me-cdc-project-nsicom.jar;C:\Java_lib\Java 3d lib\j3d-1_5_2-windows-amd64\j3d-1_5_2-windows-amd64\j3d-jre\lib\ext\j3dcore.jar;C:\Java_lib\Java 3d lib\j3d-1_5_2-windows-amd64\j3d-1_5_2-windows-amd64\j3d-jre\lib\ext\j3dutils.jar;C:\Java_lib\Java 3d lib\j3d-1_5_2-windows-amd64\j3d-1_5_2-windows-amd64\j3d-jre\lib\ext\vecmath.jar;C:\Java_lib\Java 3d lib\joalmixer-1_5_2\joalmixer-1_5_2\joalmixer.jar;C:\Program Files (x86)\NetBeans 6.9\java\modules\ext\javac-api-nb-7.0-b07.jar;C:\Program Files (x86)\NetBeans 6.9\mobility\modules\ext\cdc-pp-awt-layout.jar;C:\Program Files (x86)\NetBeans 6.9\mobility\modules\org-netbeans-modules-mobility-antext.jar;C:\Program Files (x86)\NetBeans 6.9\java\modules\org-netbeans-modules-classfile.jar;C:\Program Files (x86)\NetBeans 6.9\enterprise\modules\ext\javaee-web-api-6.0.jar;C:\Users\Justin VanDeBrake\Documents\NetBeansProjects\Intro to Java\build\classes;C:\Users\Justin VanDeBrake\Documents\NetBeansProjects\Intro to Java\src
Override ignored for property "run.jvmargs"
Override ignored for property "work.dir"
Setting project property: application.args ->
Executing 'C:\Program Files (x86)\Java\jdk1.6.0_20\bin\java.exe' with arguments:
'-Dfile.encoding=UTF-8'
'-classpath'
'C:\Program Files (x86)\NetBeans 6.9\enterprise\modules\ext\javaee-api-6.0.jar;C:\Program Files\sges-v3\javadb\lib\derby.jar;C:\Program Files\sges-v3\javadb\lib\derbyclient.jar;C:\Program Files\sges-v3\javadb\lib\derbynet.jar;C:\Program Files\sges-v3\glassfish\modules\bean-validator.jar;C:\Program Files\sges-v3\glassfish\modules\jsf-impl.jar;C:\Program Files\sges-v3\glassfish\modules\javax.security.auth.message.jar;C:\Program Files\sges-v3\glassfish\modules\endorsed\webservices-api-osgi.jar;C:\Program Files\sges-v3\glassfish\modules\endorsed\jaxb-api-osgi.jar;C:\Program Files\sges-v3\glassfish\modules\javax.servlet.jsp.jar;C:\Program Files\sges-v3\glassfish\modules\jsr311-api.jar;C:\Program Files\sges-v3\glassfish\modules\javax.security.jacc.jar;C:\Program Files\sges-v3\glassfish\modules\jsf-api.jar;C:\Program Files\sges-v3\glassfish\modules\jstl-impl.jar;C:\Program Files\sges-v3\glassfish\modules\javax.management.j2ee.jar;C:\Program Files\sges-v3\glassfish\modules\endorsed\javax.annotation.jar;C:\Program Files\sges-v3\glassfish\modules\javax.persistence.jar;C:\Program Files\sges-v3\glassfish\modules\javax.transaction.jar;C:\Program Files\sges-v3\glassfish\modules\javax.enterprise.deploy.jar;C:\Program Files\sges-v3\glassfish\modules\javax.jms.jar;C:\Program Files\sges-v3\glassfish\modules\weld-osgi-bundle.jar;C:\Program Files\sges-v3\glassfish\modules\javax.ejb.jar;C:\Program Files\sges-v3\glassfish\modules\javax.resource.jar;C:\Program Files\sges-v3\glassfish\modules\mail.jar;C:\Program Files\sges-v3\glassfish\modules\javax.servlet.jsp.jstl.jar;C:\Program Files\sges-v3\glassfish\modules\javax.servlet.jar;C:\Program Files\sges-v3\glassfish\modules\web-core.jar;C:\Program Files (x86)\NetBeans 6.9\enterprise\modules\ext\javaee6-endorsed\javax.annotation.jar;C:\Program Files (x86)\NetBeans 6.9\enterprise\modules\ext\javaee6-endorsed\jaxb-api-osgi.jar;C:\Program Files (x86)\NetBeans 6.9\enterprise\modules\ext\javaee6-endorsed\webservices-api-osgi.jar;C:\Program Files (x86)\NetBeans 6.9\mobility\modules\ext\cdc-agui-swing-layout.jar;C:\Program Files (x86)\NetBeans 6.9\mobility\ant\nblib\org-netbeans-modules-j2me-cdc-project-nsicom.jar;C:\Java_lib\Java 3d lib\j3d-1_5_2-windows-amd64\j3d-1_5_2-windows-amd64\j3d-jre\lib\ext\j3dcore.jar;C:\Java_lib\Java 3d lib\j3d-1_5_2-windows-amd64\j3d-1_5_2-windows-amd64\j3d-jre\lib\ext\j3dutils.jar;C:\Java_lib\Java 3d lib\j3d-1_5_2-windows-amd64\j3d-1_5_2-windows-amd64\j3d-jre\lib\ext\vecmath.jar;C:\Java_lib\Java 3d lib\joalmixer-1_5_2\joalmixer-1_5_2\joalmixer.jar;C:\Program Files (x86)\NetBeans 6.9\java\modules\ext\javac-api-nb-7.0-b07.jar;C:\Program Files (x86)\NetBeans 6.9\mobility\modules\ext\cdc-pp-awt-layout.jar;C:\Program Files (x86)\NetBeans 6.9\mobility\modules\org-netbeans-modules-mobility-antext.jar;C:\Program Files (x86)\NetBeans 6.9\java\modules\org-netbeans-modules-classfile.jar;C:\Program Files (x86)\NetBeans 6.9\enterprise\modules\ext\javaee-web-api-6.0.jar;C:\Users\Justin VanDeBrake\Documents\NetBeansProjects\Intro to Java\build\classes;C:\Users\Justin VanDeBrake\Documents\NetBeansProjects\Intro to Java\src'
'ProgrammingExcercises.Ch09.HangmanFile33'
The ' characters around the executable and arguments are
not part of the command.
Execute:Java13CommandLauncher: Executing 'C:\Program Files (x86)\Java\jdk1.6.0_20\bin\java.exe' with arguments:
'-Dfile.encoding=UTF-8'
'-classpath'
'C:\Program Files (x86)\NetBeans 6.9\enterprise\modules\ext\javaee-api-6.0.jar;C:\Program Files\sges-v3\javadb\lib\derby.jar;C:\Program Files\sges-v3\javadb\lib\derbyclient.jar;C:\Program Files\sges-v3\javadb\lib\derbynet.jar;C:\Program Files\sges-v3\glassfish\modules\bean-validator.jar;C:\Program Files\sges-v3\glassfish\modules\jsf-impl.jar;C:\Program Files\sges-v3\glassfish\modules\javax.security.auth.message.jar;C:\Program Files\sges-v3\glassfish\modules\endorsed\webservices-api-osgi.jar;C:\Program Files\sges-v3\glassfish\modules\endorsed\jaxb-api-osgi.jar;C:\Program Files\sges-v3\glassfish\modules\javax.servlet.jsp.jar;C:\Program Files\sges-v3\glassfish\modules\jsr311-api.jar;C:\Program Files\sges-v3\glassfish\modules\javax.security.jacc.jar;C:\Program Files\sges-v3\glassfish\modules\jsf-api.jar;C:\Program Files\sges-v3\glassfish\modules\jstl-impl.jar;C:\Program Files\sges-v3\glassfish\modules\javax.management.j2ee.jar;C:\Program Files\sges-v3\glassfish\modules\endorsed\javax.annotation.jar;C:\Program Files\sges-v3\glassfish\modules\javax.persistence.jar;C:\Program Files\sges-v3\glassfish\modules\javax.transaction.jar;C:\Program Files\sges-v3\glassfish\modules\javax.enterprise.deploy.jar;C:\Program Files\sges-v3\glassfish\modules\javax.jms.jar;C:\Program Files\sges-v3\glassfish\modules\weld-osgi-bundle.jar;C:\Program Files\sges-v3\glassfish\modules\javax.ejb.jar;C:\Program Files\sges-v3\glassfish\modules\javax.resource.jar;C:\Program Files\sges-v3\glassfish\modules\mail.jar;C:\Program Files\sges-v3\glassfish\modules\javax.servlet.jsp.jstl.jar;C:\Program Files\sges-v3\glassfish\modules\javax.servlet.jar;C:\Program Files\sges-v3\glassfish\modules\web-core.jar;C:\Program Files (x86)\NetBeans 6.9\enterprise\modules\ext\javaee6-endorsed\javax.annotation.jar;C:\Program Files (x86)\NetBeans 6.9\enterprise\modules\ext\javaee6-endorsed\jaxb-api-osgi.jar;C:\Program Files (x86)\NetBeans 6.9\enterprise\modules\ext\javaee6-endorsed\webservices-api-osgi.jar;C:\Program Files (x86)\NetBeans 6.9\mobility\modules\ext\cdc-agui-swing-layout.jar;C:\Program Files (x86)\NetBeans 6.9\mobility\ant\nblib\org-netbeans-modules-j2me-cdc-project-nsicom.jar;C:\Java_lib\Java 3d lib\j3d-1_5_2-windows-amd64\j3d-1_5_2-windows-amd64\j3d-jre\lib\ext\j3dcore.jar;C:\Java_lib\Java 3d lib\j3d-1_5_2-windows-amd64\j3d-1_5_2-windows-amd64\j3d-jre\lib\ext\j3dutils.jar;C:\Java_lib\Java 3d lib\j3d-1_5_2-windows-amd64\j3d-1_5_2-windows-amd64\j3d-jre\lib\ext\vecmath.jar;C:\Java_lib\Java 3d lib\joalmixer-1_5_2\joalmixer-1_5_2\joalmixer.jar;C:\Program Files (x86)\NetBeans 6.9\java\modules\ext\javac-api-nb-7.0-b07.jar;C:\Program Files (x86)\NetBeans 6.9\mobility\modules\ext\cdc-pp-awt-layout.jar;C:\Program Files (x86)\NetBeans 6.9\mobility\modules\org-netbeans-modules-mobility-antext.jar;C:\Program Files (x86)\NetBeans 6.9\java\modules\org-netbeans-modules-classfile.jar;C:\Program Files (x86)\NetBeans 6.9\enterprise\modules\ext\javaee-web-api-6.0.jar;C:\Users\Justin VanDeBrake\Documents\NetBeansProjects\Intro to Java\build\classes;C:\Users\Justin VanDeBrake\Documents\NetBeansProjects\Intro to Java\src'
'ProgrammingExcercises.Ch09.HangmanFile33'
The ' characters around the executable and arguments are
not part of the command.
Press 0 to exit
or
Enter a Difficulty, Easy(1) Medium(2) Hard(3) or Extreme(4):
1
Exception in thread "main" java.util.NoSuchElementException
54
at java.util.Scanner.skip(Scanner.java:1706)
at java.util.Scanner.skip(Scanner.java:1723)
at ProgrammingExcercises.Ch09.HangmanFile33.PickWord(HangmanFile33.java:53)
at ProgrammingExcercises.Ch09.HangmanFile33.main(HangmanFile33.java:32)
Java Result: 1
BUILD SUCCESSFUL (total time: 4 seconds)
Could not load class (org.apache.tools.ant.taskdefs.repository.MavenRepository) for type mavenrepository
Could not load a dependent class (jdepend/xmlui/JDepend) for type jdepend
Could not load class (org.apache.tools.ant.taskdefs.optional.ejb.Ejbc) for type ejbc
Could not load class (org.apache.tools.ant.taskdefs.optional.ejb.WLStop) for type wlstop
Could not load class (org.apache.tools.ant.taskdefs.optional.ejb.WLRun) for type wlrun
Could not load a dependent class (javax/media/jai/PlanarImage) for type image
Could not load class (org.apache.tools.ant.taskdefs.optional.ejb.DDCreator) for type ddcreator
Could not load class (org.apache.tools.ant.taskdefs.optional.starteam.StarTeamCheckin) for type stcheckin
Could not load class (org.apache.tools.ant.taskdefs.optional.starteam.StarTeamCheckout) for type stcheckout
Could not load class (org.apache.tools.ant.taskdefs.optional.starteam.StarTeamLabel) for type stlabel
Could not load class (org.apache.tools.ant.taskdefs.optional.starteam.StarTeamList) for type stlist
Could not load class (org.apache.tools.ant.taskdefs.optional.scm.AntStarTeamCheckOut) for type starteam
Could not load class (org.apache.tools.ant.taskdefs.repository.MavenRepository) for type mavenrepository
Could not load a dependent class (jdepend/xmlui/JDepend) for type jdepend
Could not load class (org.apache.tools.ant.taskdefs.optional.ejb.Ejbc) for type ejbc
Could not load class (org.apache.tools.ant.taskdefs.optional.ejb.WLStop) for type wlstop
Could not load class (org.apache.tools.ant.taskdefs.optional.ejb.WLRun) for type wlrun
Could not load a dependent class (javax/media/jai/PlanarImage) for type image
Could not load class (org.apache.tools.ant.taskdefs.optional.ejb.DDCreator) for type ddcreator
Could not load class (org.apache.tools.ant.taskdefs.optional.starteam.StarTeamCheckin) for type stcheckin
Could not load class (org.apache.tools.ant.taskdefs.optional.starteam.StarTeamCheckout) for type stcheckout
Could not load class (org.apache.tools.ant.taskdefs.optional.starteam.StarTeamLabel) for type stlabel
Could not load class (org.apache.tools.ant.taskdefs.optional.starteam.StarTeamList) for type stlist
Could not load class (org.apache.tools.ant.taskdefs.optional.scm.AntStarTeamCheckOut) for type starteam