I recently installed Eclipse on my Debian machine and installed a JDK (22 to be specific). Whenever I try to run anything I get this error:
Syntax error: word unexpected (expecting ")")
The code is a simple hello world print, so I know for sure the syntax is not the problem, since I’ve written it by hand and copied it and the same error occurs, so I’m fairly certain I did something wrong while making the project file or installing the IDE/JDK.
In case I’ve made a mistake, this is the code I’m trying to run:
package bunajava;
public class HelloJava {
public static void main(String[] args) {
System.out.println("Hello Java");
}
}
I’ve tried changing the class name to the module name, and that solved part of the problem, now I only have this issue, and I couldn’t find anything on here…
I’ve also got more errors relating to file paths, though I couldn’t understand them..
Here is one of the errors:
/home/manole/Documents/SDK/jdk-23_linux-aarch64_bin/jdk-23/bin/java: 1: �h�������������: not found.
I’m new to java and I have no idea what the problem could be..
Thanks in advance.
You need to sign in to view this answers