Java
--
Questions
--
Followers
Top Experts
There is nothing to click. Please check the screenshot.
Regards.
screenshot.32.jpg
Zero AI Policy
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
I set the language level as follows in the shot. The thing is that I saw the red error sign but it's not clickable.
In my code, I have a line that requires Java7 as follows:
try(FileInputStream fis = new FileInputStream(file); CheckedInputStream cis = new CheckedInputStream(fis, crc);){
sizeOfFile = file.length();
byte[] buffer = new byte[4096];
while(cis.read(buffer)>=0)
{
checksum = cis.getChecksum().getValue();
}
System.out.println("The checksum of the file" + file + " is: " + checksum);
System.out.println("The file size is: " + sizeOfFile + " bytes");
}
}
catch(IOException e){
System.out.println("IO Exception thrown");
e.printStackTrace();
System.exit(1);
}
What should I set the language for this?
Regards.
C:\Workdir\Crypto\CRCPro\src\com\baran\crc>javac -version
javac 1.7.0_21
C:\Workdir\Crypto\CRCPro\src\com\baran\crc>javac -source 1.7.0_21 target 1.7.0_2
1 *.java
javac: invalid source release: 1.7.0_21
Usage: javac <options> <source files>
use -help for a list of possible options
My environmental variables as system variable in windows is as follows:
JAVA_HOME C:\Program Files\Java\jdk1.7.0_21\bin
And actually you need to set neither source nor target in your case (since you're using 1.7)






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
Regards.

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
Java
--
Questions
--
Followers
Top Experts
Java is a platform-independent, object-oriented programming language and run-time environment, designed to have as few implementation dependencies as possible such that developers can write one set of code across all platforms using libraries. Most devices will not run Java natively, and require a run-time component to be installed in order to execute a Java program.