Page 1 of 2

Eclipse red cross errors

Posted: Fri Jul 06, 2012 3:12 pm
by RogerSmith
L2J Revision Number:5463
L2JDP Revision Number:8954

Just checked out these from SVN.
I constantly get errors in forms of red crosses in the package viewer.

Latest eclipse with Java JRE and JDK 7.0.5 (or something like this)

http://imageshack.us/photo/my-images/17 ... lipse.png/

The fault is on my end?

Re: Eclipse red cross errors

Posted: Fri Jul 06, 2012 3:37 pm
by RogerSmith
Had to select jre7 in preferances manually.

Errors disappeared but it won't let me build - says I have java 1.6, just reinstalled JDK7u5 still same.

halp./

Re: Eclipse red cross errors

Posted: Fri Jul 06, 2012 4:52 pm
by jurchiks
you should select the default JDK in the JREs settings aswell. It is possible that you have both JDK6 and 7 and Eclipse has the first one set as default.

Re: Eclipse red cross errors

Posted: Fri Jul 06, 2012 5:59 pm
by RogerSmith
Checked jre7 in the preferances.
Then in the execution environments checked jre7 for JavaSE 1.7.

Still doesn't do it.

Where do I choose the JDK?

Re: Eclipse red cross errors

Posted: Fri Jul 06, 2012 7:14 pm
by jurchiks
you sure you've installed JDK, not JRE?
Preferences->Java->Installed JREs->Add...->Standart VM->next->Directory... -> C:\Program Files\Java\jdk1.7.0_05\jre or whatever your path is. It should then list some libraries in the JRE Definition window. Click Finish and check the checkbox of the jdk in the list. That should be it.
You might need to restart Eclipse to be able to check it as the default in Execution Environments.

Re: Eclipse red cross errors

Posted: Fri Jul 06, 2012 9:44 pm
by RogerSmith
I downloaded the JDK pack off the oracle.

Says includes both the JRE and JDK


What the compiler keeps insisting is to compile with java 1.6.

I restarted a bunch of times and checked all the checkbox that have any involvement with java 1.7.

Re: Eclipse red cross errors

Posted: Fri Jul 06, 2012 9:48 pm
by jurchiks
Java->compiler->compliance level=1.7
I've also noticed that sometimes the l2j project, when freshly downloaded, has compliance level set to some empty value and eclipse sets it to 1.4 or smth. to fix that, just open project properties and change the compliance level to 1.7

Re: Eclipse red cross errors

Posted: Fri Jul 06, 2012 9:58 pm
by RogerSmith
Did it both ways, still won't say I have java 1.7

THis is what it looks like for me

http://imageshack.us/photo/my-images/35 ... ndjdk.png/

http://imageshack.us/photo/my-images/19 ... nment.png/

Re: Eclipse red cross errors

Posted: Fri Jul 06, 2012 10:55 pm
by MELERIX
lol, seems you have mixed Java 6 and 7 versions at same time.

uninstall any Java version from your computer, and then follow this guides step by step: viewtopic.php?f=2&t=10719

Re: Eclipse red cross errors

Posted: Fri Jul 06, 2012 11:52 pm
by RogerSmith
Deleted all Java

Installed just JDK7u5 and whatever came with it.

Updated JAVA_HOME (didn't do last time)

Launch eclipse, check preferances for JRE - everything in place.

Still tried to compile with Java 1.6 - says the jre6 (which I had previously) could not be found (cos duh I uninstalled it)

Re: Eclipse red cross errors

Posted: Sat Jul 07, 2012 12:15 am
by RogerSmith
Found a fix

http://exploreriddles.blogspot.co.uk/20 ... stall.html

Used option 2.

Compiled.

Re: Eclipse red cross errors

Posted: Sat Jul 07, 2012 12:06 pm
by jurchiks
Still tried to compile with Java 1.6
l2j uses Java 1.7...
Have you set the compiler to java 7 in both workspace and project preferences?

Re: Eclipse red cross errors

Posted: Sat Jul 07, 2012 5:46 pm
by RogerSmith
jurchiks wrote:
Still tried to compile with Java 1.6
l2j uses Java 1.7...
Have you set the compiler to java 7 in both workspace and project preferences?
I don't know what was done or not. I had Java 1.6 and that's what it kept trying to compile with. Even after I uninstalled everything it wouldn't try it with 1.7.

I did this:
Go to RUN->External Tools ->External Tools Configurations…
Select your build.xml(in my case it is abc build.xml). Move to JRE tab.
Select the appropriate JRE.
This solved it.

The ant build would now compile with 1.7.

Re: Eclipse red cross errors

Posted: Sat Jul 07, 2012 5:50 pm
by jurchiks
that's not the right way to solve it...

Re: Eclipse red cross errors

Posted: Sat Jul 07, 2012 8:17 pm
by RogerSmith
The right way didn't work :P