Solved

Where are the errors in the intellij?

Posted on 2013-05-30
9
2,401 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
split53 challenge 7 79
Java array passed to SQL where clause 23 63
thymeleaf natural templating vs JSP 2 68
What is the Best Editor for PHP Development ? 5 67
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
This video teaches viewers about errors in exception handling.
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…

895 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now