Link to home
Create AccountLog in
Java

Java

--

Questions

--

Followers

Top Experts

Avatar of jazzIIIlove
jazzIIIloveπŸ‡ΈπŸ‡ͺ

Where are the errors in the intellij?
Thanks to intellij, I can see that I cannot compile the program. As in the shot, in the event viewer, I see that I have the error but where is the error? Which line?

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.


ASKER CERTIFIED SOLUTION
Avatar of CEHJCEHJπŸ‡¬πŸ‡§

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

SOLUTION
Avatar of ValeriValeriπŸ‡§πŸ‡¬

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.

Avatar of jazzIIIlovejazzIIIloveπŸ‡ΈπŸ‡ͺ

ASKER

Hi;

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);
		}

Open in new window


What should I set the language for this?

Regards.
screenshot.34.jpg

SOLUTION
Avatar of CEHJCEHJπŸ‡¬πŸ‡§

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.

Avatar of jazzIIIlovejazzIIIloveπŸ‡ΈπŸ‡ͺ

ASKER

funny thing is that as said it's working in eclipse without an issue but when it comes to command line:
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

Open in new window


My environmental variables as system variable in windows is as follows:
JAVA_HOME C:\Program Files\Java\jdk1.7.0_21\bin

Avatar of CEHJCEHJπŸ‡¬πŸ‡§

javac is only interested in major versions - 1.5,1.6, 1.7 etc
And actually you need to set neither source nor target in your case (since you're using 1.7)

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of jazzIIIlovejazzIIIloveπŸ‡ΈπŸ‡ͺ

ASKER

Ok, I solved this. The problem is the language level in project settings, intellij. I had chosen level 8 since the expression above requires Java 1.7 but there is no level 8 and it fails. I take it to level 7 and voila.

Regards.

Avatar of jazzIIIlovejazzIIIloveπŸ‡ΈπŸ‡ͺ

ASKER

i simply had omitted the suggestion..He said this hours ago...Sorry.

Avatar of CEHJCEHJπŸ‡¬πŸ‡§

:)

Free T-shirt

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

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.