Solved

Where are the errors in the intellij?

Posted on 2013-05-30
9
2,435 Views
Last Modified: 2013-05-31
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
Comment
Question by:jazzIIIlove
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
9 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 333 total points
ID: 39207956
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
 
LVL 16

Assisted Solution

by:Valeri
Valeri earned 167 total points
ID: 39208276
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
 
LVL 12

Author Comment

by:jazzIIIlove
ID: 39210066
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!

 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 333 total points
ID: 39210149
Yes, that should be set to Java 7. As for the language level, i'm not sure what your choices are ...
0
 
LVL 12

Author Comment

by:jazzIIIlove
ID: 39210567
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
 
LVL 86

Expert Comment

by:CEHJ
ID: 39210613
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
 
LVL 12

Author Comment

by:jazzIIIlove
ID: 39210689
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
 
LVL 12

Author Closing Comment

by:jazzIIIlove
ID: 39210695
i simply had omitted the suggestion..He said this hours ago...Sorry.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 39210914
:)
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand column That will then direct you to their download page. From that p…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question