Just going through the sample Scala code on Scala website, but encountered an annoying error when trying to run it.
Here\'s the code: http://www.scala-lang.org/node/
Have faced the similar issue, resolved this by right clicking on the main method in the outline view and run as Java application.
I just had this problem too. The solution is to make sure eclipse created the project as Java project. Just create a new Java project and copy your class into the src folder (and import the eventual dependencies). This should fix the problem.
For me, in Eclipse 3.6, this problem occurs when my main method is not public. I caused the problem by having a main method like this:
static void main(String[] args)
The dubugger was unable to detect this by itself. I am pretty suprised Eclipse overlooked this.
If it is maven project please check the java file is created under src/main/java
If you are not getting please change the JRE path and create the java files in above folder structure
This could be the issue with the Java Build path. Try below steps :
This should resolve the issue.
you should create your file by
selecting on right side you will find your file name,
under that will find src folder their you right click select -->class option
their your file should be created