I started using Ant, that ships with Eclipse. It annoys me, that I get hundreds of warnings in the lines of:
[javac] warning: java\io\BufferedInputStream.class(java\io:BufferedInputStream.class): major version 51 is newer than 50, the highest major version supported by this compiler.
[javac] It is recommended that the compiler be upgraded.
How do I upgrade compiler?
To configure compiler compliance level and settings in eclipse, find the below steps. Step 2: Go to Java -> Compiler . Find the print screen. Step 4: To change default compliance settings, we need to uncheck Use default compliance settings and set the compiler java version for .
It can be added from the Window > Preferences > Java > Installed JREs > Add... page. It can also be added from the Package Explorer using the project's context menu. An option to set compiler compliance to 11 on a Java project is also provided.
Eclipse 4.23 (2022-03) It is the supported release. A Java 11 or newer JRE/JDK is required, LTS release are preferred to run all Eclipse 2022-03 packages based on Eclipse 4.23, with certain packages choosing to provide one by default. The Installer now also includes a JRE--consider using the Installer.
download and install newer version of JDK.
Windows - > Preference - > Java - > Installed JRE
set newer version here
Major version 51 is Java 7 - looks like you're developing against a preview Java 7 API library but compiling with a Java 6 javac. Either make sure ant uses the Java 7 compiler, or use a Java 6 API library to compile against.
Thanks, I figured it out.
For those whom it may concern, to make sure Ant uses the Java 7 compiler:
Preferences -> Ant -> Runtime -> Classpath -> Global Entries
Click Add External Jars
and put your tools.jar
here.
It will look something like C:\Program Files\Java\jdk1.7.0_03\lib
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With