• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2485
  • Last Modified:

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
0
jazzIIIlove
Asked:
jazzIIIlove
  • 4
  • 4
3 Solutions
 
CEHJCommented:
Look down on the left hand side at the bottom (not surprised you don't notice red error messages with that colour scheme ;))

'invalid source release: 8'

I suspect you have a setting wrong in the project. Set the source release as low as possible, Certainly not higher than 7
0
 
ValeriCommented:
in intellij you have to go to Project settings and to change "language level" to the right one. As CEHJ suggested to 7 or 6. For more info take a look here:
http://wiki.jetbrains.net/intellij/Setting_up_a_project_in_IntelliJ_IDEA#Exploring_the_General_Project_Settings
0
 
jazzIIIloveAuthor Commented:
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
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
CEHJCommented:
Yes, that should be set to Java 7. As for the language level, i'm not sure what your choices are ...
0
 
jazzIIIloveAuthor Commented:
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
0
 
CEHJCommented:
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)
0
 
jazzIIIloveAuthor Commented:
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.
0
 
jazzIIIloveAuthor Commented:
i simply had omitted the suggestion..He said this hours ago...Sorry.
0
 
CEHJCommented:
:)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now