Solved

Where are the errors in the intellij?

Posted on 2013-05-30
9
2,391 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
How Complex Is This Java Course ? 9 62
json format text only 4 65
HashMap Vs TreeMap 12 48
ArrayIndexOutOfBoundException 9 30
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
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.
The viewer will learn how to implement Singleton Design Pattern in Java.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

707 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

13 Experts available now in Live!

Get 1:1 Help Now