Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#8977 - Eclipse PKGBUILD has incorrect dependency

Attached to Project: Arch Linux
Opened by Raymano Garibaldi (raymano) - Thursday, 20 December 2007, 05:01 GMT
Last edited by Greg (dolby) - Thursday, 31 July 2008, 03:07 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Jan de Groot (JGC)
Paul Mattal (paul)
Architecture All
Severity Medium
Priority Normal
Reported Version 2007.08-2
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

Eclipse has a dependency to (jdk>=1.5). However the current eclipse in the extra repo only works with jdk 1.6.



Steps to reproduce:
1) Install eclipse from extra
2) Downgrade jdk and jre to 1.5
3) Run eclipse from command-line to see the following exception:
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file

This task depends upon

Closed by  Greg (dolby)
Thursday, 31 July 2008, 03:07 GMT
Reason for closing:  Fixed
Comment by Paul Mattal (paul) - Monday, 31 December 2007, 16:49 GMT
Thanks for pointing this out! I will probably resolve this by changing the dependency to >= 6, unless you specifically need/desire support for 1.5, in which case I'll consider looking into that.
Comment by Raymano Garibaldi (raymano) - Tuesday, 01 January 2008, 16:11 GMT
No problem.There are a lot of Java projects out there that do not support JDK 1.6 yet. Specially server-side Java projects. I think support for JDK 1.5 is still important.
Comment by Jan de Groot (JGC) - Saturday, 05 January 2008, 21:44 GMT
I looked through the eclipse release notes, actually there's only a small amount of files that needs 1.6. These files are new things only possible with java6, you can't use these plugins with older jdk versions, but they don't have any use on those older jdk versions either.

If possible, I would like to have an eclipse package built from source at 1.5 compatibility level, where the files that need 1.6 as source/target version will have that version set. The dependency should be changed to java-runtime then and eclipse should be able to run with java-gcj-compat also.
Comment by Paul Mattal (paul) - Saturday, 05 January 2008, 22:26 GMT
I am not fond of repeating the entire JDK 1.4 debacle again for 1.5. Keeping backward compatibility massively increases the workload for maintaining this package, and makes the process for building the package highly nonstandard.

If we had jdk1.5 and jre1.5 packages, I would be happy to build using jdk1.5, but fudging the build process for compatibility with other JVMs not in our repos seems to be both pointless and an endless source of work I'm not excited about. It's also not generally the Arch way to be supporting older versions of JVMs when the new ones work with the software, though I can understand the desire in this case, and would like to find a way to do it that isn't overly ugly or burdensome.

I am more than willing to make the dependencies generic so that java-gcj-compat can be used by those who wish it, and I'm even happy to apply any necessary workarounds these users find to enable eclipse compatibility with java-gcj-compat as they come up. However, I do not plan to full-out test and support JVMs other than Sun's.

All that said, Eclipse has always been dependent on the JDK, not just the JRE. Is java-runtime sufficient, or does Eclipse need to have a development kit around? I'll have to play with this if it's not immediately apparent.
Comment by Jan de Groot (JGC) - Saturday, 05 January 2008, 22:44 GMT
We have java-environment provided by both jdk and java-gcj-compat. I think it's pretty pointless to have a java IDE that doesn't depend on the tools it needs to build java projects.

I've tried to build eclipse with gcj now, it works quite well though it bails out after 22 minutes with an error in some build.xml file, which is either ant related or something fishy going on.

Eclipse builds eclipse-ecj with the compiler found on the system. It then uses this compiler to compile itself. This compiler has a nice feature: it generates code that matches the runtime that drives it. Some buildfiles don't contain source/target versions, so when built with jre6 it will generate java 1.6 binaries.

I'll take a look at resolving this build issue, if I can get it resolved I could change the dependencies to java-environment and makedepend on java-gcj-compat to make sure java5 code is generated.

About supporting multiple JREs: the gcj/eclipse-ecj combination looks quite promising and is supported by a lot of other packages on archlinux. As long as IcedTea isn't complete, I think it's sane to support gcj/eclipse-ecj as much as we can.
Comment by Jan de Groot (JGC) - Sunday, 06 January 2008, 01:47 GMT
Hmm, I tracked down the build problem: eclipse-ecj can't build java6 code when it's driven by a java5 runtime.
This leaves us with two choices:
- build with java6, set target to 1.5 for everything except the parts that require java6
- build with java5, remove everything that requires java6

I think the first option would be the best for both worlds.
Comment by Paul Mattal (paul) - Monday, 07 January 2008, 13:54 GMT
I agree that your first suggestion is the best. Have to believe there's someone out there doing exactly that, right? In fact, I was surprised to find out it wasn't just the default behavior.

I'll look into this when I get a few minutes. If you discover anything in the meanwhile, post here.

Thanks!
Comment by Jan de Groot (JGC) - Monday, 07 January 2008, 14:11 GMT
I tried option 1, but on amd64 I haven't been able to get a succesful build with Sun JDK. The build hangs itself at the assembling stage and eats CPU cycles forever until I kill it.

I needed to patch 4 build.xml files to get this thing done. In the meanwhile I cleaned up the PKGBUILD aswel:
- no more /etc/profile.d script for eclipse, just use an eclipse launcher in /usr/bin
- desktop file points to /usr/bin/eclipse
- change makedepend to jdk>=6u3
- change dependency to java-environment
- add versioned depend on gtk2

I'll see what I can do with an i686 build, the PKGBUILD noted something about not being able to build on AMD64 or so.
Comment by Paul Mattal (paul) - Monday, 07 January 2008, 14:19 GMT
I've had the same freezing problem on i686. When I try several times on different machines, I can usually get at least one good build in 5 or so. This build quirk has existed since I inherited the package-- very hard to pin down.

Thanks for the quick work! If you check in your changes, I can try an i686 build here.
Comment by Paul Mattal (paul) - Tuesday, 15 July 2008, 12:47 GMT
I'm planning to switch to binaries, which I believe should work with JDKs all the way back into the 1.4s. Stay tuned.
Comment by Jan de Groot (JGC) - Tuesday, 15 July 2008, 12:55 GMT
Note that we'll include openjdk/icedtea in a while which will deprecate java-gcj-compat in our distribution. It's not a requirement to work with java 1.4 or 1.5 anymore then.

Loading...