score:1
download and install the current eclipse version. eclipse has a build-in java compiler. switching on string
s was added in java se 1.7. java se 1.4 is a very old version of java. it's not a good idea to learn programming using a version of java which is that old.
also, as the other answer suggests, install the latest jdk.
score:0
your friend is correct in saying that it is because of a compiler compliance level. in order to be able to fix your problem, your compiler must be version 1.7 or 1.8. if you're using an ide, you'll need to download a jdk to match up to whichever version you need (would recommend 1.8 as it's not eol'd). if you're using maven, you can change your compiler level by using the maven compiler plugin.
Source: stackoverflow.com
Related Query
- Can't switch to compiler compliance level 1.8 in Eclipse Helios
- Eclipse chokes on enum, even though Compiler compliance level is 1.6
- How do I change the default Eclipse Oxygen compiler compliance level from 9 to 1.8 and not have it revert back to 9?
- Is setting eclipse java compiler compliance level 1.6 same as compile using JDK 1.6?
- Eclipse Indigo: Compiler compliance level 1.7 is missing from the list
- Eclipse resets Java compiler compliance level to 1.7 with every restart
- Java - Eclipse Compiler Compliance Level 1.6 not working as expected
- Compiler compliance level in Eclipse
- Why won't Eclipse switch the compiler to Java 8?
- "Cannot switch on a value of type String for source level below .." error in Eclipse
- Set default java compliance level for Maven projects in Eclipse
- Have two JDK installed, how to switch the java compiler in Eclipse
- Eclipse Updating the compiler compliance to 1.7
- Eclipse says jre does not support the current compiler level of 1.8 but it is set at 1.7
- Switch Case error. Eclipse IDE for Android development on Mac : Change workspace compliance to JRE 1.7
- No Java 1.8 compiler compliance level when running Android Bundle/Eclipse Juno under Oracle JDK 8
- Eclipse compiler options - How can I set the debug level
- Unsupported major.minor version 52.0 + Android requires compiler compliance level 5.0 or 6.0. Found '1.8' instead
- Found '1.8' instead. Android requires compiler compliance level 5.0 or 6.0. Please use Android Tools > Fix Project Properties
- 1.7 compiler compliance level is not yet supported in MyEclipse
- eclipse error, "Cannot switch on a value of type String for source level below 1.7"
- Why does Eclipse complain that the project specifies compiler compliance 1.8 but a JRE 11 is used?
- Android project using Eclipse gives error: Cannot switch on a value of type String for source level below 1.7
- Trying to set java compiler to compliance level to 5.0
- Adding compiler switch to Eclipse CDT Built-In Compiler Settings generation?
- How to set jdk compiler compliance level to 10?
- Eclipse: Java : Source compatibility vs Compiler Compliance level
- Bug Compliance Level in Eclipse
- Cant get my Eclipse compiler warnings in my PDE Build
- How to set Eclipse compiler level to 1.1
More Query from same tag
- Eclipse Juno jar android dependencies issues
- How to configure Eclipse's Package Explorer to display like IntelliJ IDEA's package view?
- Returning the biggest three digit number
- How to obtain line and/or column from parsed java source from Eclipse JDT Parser from all nodes?
- font-size of the tree-view ecilpse in ubuntu
- BIRT WebViewerExample - default location of report design
- Java's BigInteger toString method not returning a (non-empty) String for large integers
- How to create a header file
- Import project with no .project file
- git takes huge time to build when I change my branch
- Maven Dependency showing up as a folder inside Maven Dependencies folder
- How to run multiple feature files on same thread
- android listview with real-time sensor updates
- Groovy Eclipse Stubbed Method
- cocos2d-x undefined reference
- How to un-tab whole block?
- How to generate simple java class from WSDL?
- EclEmma code coverage plugin and PowerMockRunner
- Change an Eclipse key binding to work anywhere in the program
- Getting UnsupportedClassVersionError in Eclipse JPA project which does not make sense
- Execute background action in Eclipse RAP application
- Is there a way of comparing two open files without using package explorer/project/navigator?
- Libgdx FileHandle list() method doesn't work in jar file
- mvn package load other Library as Eclipse
- Error when trying to compile java files in project with Protocol Buffers
- Remove Eclipse src folder
- Eclipse to register new file type to appear as php code style?
- Remote debugging Python in Eclipse
- How to disable global(File-->Rename) menu in RCP application
- Force mvn eclipse:eclipse to pick latest jar