Solved

Where are the errors in the intellij?

Posted on 2013-05-30
9
2,416 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
  • 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
How our DevOps Team Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

 
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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…

825 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