error: cannot find symbol
Result result = JUnitCore.runClasses(PrintGrades2Test);
symbol: variable PrintGrades2Test
location: class NetBeansTestExample2
Compiling 2 source files to D:..............\NetBeansTestExample2\build\classes
D:........\NetBeansTestExample2\src\netbeanstestexample2\NetBeansTestExample2.java:24: error: cannot find symbol
Result result = JUnitCore.runClasses(PrintGrades2Test);
symbol: variable PrintGrades2Test
location: class NetBeansTestExample2
1 error
D:........\NetBeansTestExample2\nbproject\build-impl.xml:929: The following error occurred while executing this line:
D:.........\NetBeansTestExample2\nbproject\build-impl.xml:269: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 1 second)
run:
C:\Users\....\AppData\Local\NetBeans\Cache\8.1\executor-snippets\run.xml:48:
Cancelled by user.
BUILD FAILED (total time: 4 seconds)
https://netbeans.org/bugzilla/show_bug.cgi?id=217710
C:\Users\HP\AppData\Local\NetBeans\Cache\8.2\executor-snippets\run.xml:48:
Cancelled by user.
BUILD FAILED (total time: 2 seconds)
All things are lawful, but not all things are profitable.
cannot find symbol: class PrintGrades2Test
May split declaration into declaration and assignment.
Zulfi Khan wrote:I tried to remove the error by attaching the package name but still I am getting error:
Zulfi Khan wrote:1st approach
JavaJUNITExample8_2\src\javajunitexample8_2\JavaJUNitExample8_2.java
JavaJUNITExample8_2\src\javajunitexample8_2\PrintGrades2.java
JavaJUNITExample8_2\src\javajunitexample8_2\PrintGrades2Test.java
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous tree type: <any>
at javajunitexample8_2.JavaJUNITExample8_2.main(JavaJUNITExample8_2.java:23)
C:\Users\HP\AppData\Local\NetBeans\Cache\8.2\executor-snippets\run.xml:53: Java returned: 1
BUILD FAILED (total time: 2 seconds)
Zulfi Khan wrote:Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous tree type: <any>
at javajunitexample8_2.JavaJUNITExample8_2.main(JavaJUNITExample8_2.java:23)
C:\Users\HP\AppData\Local\NetBeans\Cache\8.2\executor-snippets\run.xml:53: Java returned: 1
BUILD FAILED (total time: 2 seconds)
ant -f "D:\\java prog\\ttu_Independent_Study_SE\\8P2NB\\JavaJUNITExample8_2" -Dnb.internal.action.name=rebuild clean jar
init:
deps-clean:
Updating property file: D:\java prog\ttu_Independent_Study_SE\8P2NB\JavaJUNITExample8_2\build\built-clean.properties
Deleting directory D:\java prog\ttu_Independent_Study_SE\8P2NB\JavaJUNITExample8_2\build
clean:
init:
deps-jar:
Created dir: D:\java prog\ttu_Independent_Study_SE\8P2NB\JavaJUNITExample8_2\build
Updating property file: D:\java prog\ttu_Independent_Study_SE\8P2NB\JavaJUNITExample8_2\build\built-jar.properties
Created dir: D:\java prog\ttu_Independent_Study_SE\8P2NB\JavaJUNITExample8_2\build\classes
Created dir: D:\java prog\ttu_Independent_Study_SE\8P2NB\JavaJUNITExample8_2\build\empty
Created dir: D:\java prog\ttu_Independent_Study_SE\8P2NB\JavaJUNITExample8_2\build\generated-sources\ap-source-output
Compiling 3 source files to D:\java prog\ttu_Independent_Study_SE\8P2NB\JavaJUNITExample8_2\build\classes
D:\java prog\ttu_Independent_Study_SE\8P2NB\JavaJUNITExample8_2\src\javajunitexample8_2\JavaJUNITExample8_2.java:23: error: cannot find symbol
Result result = JUnitCore.runClasses(PrintGrades2Test.class);
symbol: class PrintGrades2Test
location: class JavaJUNITExample8_2
1 error
D:\java prog\ttu_Independent_Study_SE\8P2NB\JavaJUNITExample8_2\nbproject\build-impl.xml:930: The following error occurred while executing this line:
D:\java prog\ttu_Independent_Study_SE\8P2NB\JavaJUNITExample8_2\nbproject\build-impl.xml:270: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 1 second)
My PrintGrades2test.java
Zulfi.
Exception in thread "main" java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.junit.runner.Computer.getSuite(Computer.java:26)
at org.junit.runner.Request.classes(Request.java:69)
at org.junit.runner.JUnitCore.run(JUnitCore.java:127)
at org.junit.runner.JUnitCore.runClasses(JUnitCore.java:76)
at javajunitexample8_2.JavaJUNITExample8_2.main(JavaJUNITExample8_2.java:23)
Caused by: java.lang.ClassNotFoundException: org.hamcrest.SelfDescribing
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 17 more
C:\Users\HP\AppData\Local\NetBeans\Cache\8.2\executor-snippets\run.xml:53: Java returned: 1
BUILD FAILED (total time: 0 seconds)
Don't get me started about those stupid light bulbs. |