TestNG An internal error occurred during launching source not found

I created a TestNG class (SampleTest.java) and when I run the test case as TestNG Test, I am getting the following error.

Launching Sample Test has encountered a problem.

An internal error occurred during: "Launching SampleTest".

source not specified

Stack Trace:

java.lang.IllegalStateException: source not specified at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:813) at org.testng.eclipse.util.param.ParameterSolver.getParserNode(ParameterSolver.java:135) at org.testng.eclipse.util.param.ParameterSolver.parseParameterNames(ParameterSolver.java:125) at org.testng.eclipse.util.param.ParameterSolver.solveParameters(ParameterSolver.java:112) at org.testng.eclipse.util.param.ParameterSolver.getParameterNames(ParameterSolver.java:90) at org.testng.eclipse.util.param.ParameterSolver.solveParameters(ParameterSolver.java:59) at org.testng.eclipse.ui.util.ConfigurationHelper.getLaunchSuites(ConfigurationHelper.java:422) at org.testng.eclipse.launch.TestNGLaunchConfigurationDelegate.createVMRunner(TestNGLaunchConfigurationDelegate.java:296) at org.testng.eclipse.launch.TestNGLaunchConfigurationDelegate.launchTypes(TestNGLaunchConfigurationDelegate.java:161) at org.testng.eclipse.launch.TestNGLaunchConfigurationDelegate.launch(TestNGLaunchConfigurationDelegate.java:91) at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:885) at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:739) at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1039) at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1256) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)

Eclipse Version: Version: Oxygen.2 Release (4.7.2)

Please Help!!!