FS#9969 - JUnit to add itself to CLASSPATH

Attached to Project: Arch Linux
Opened by Xilon (Xilon) - Wednesday, 26 March 2008, 08:44 GMT
Last edited by Jan de Groot (JGC) - Wednesday, 26 March 2008, 16:48 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version 2007.08-2
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
This isn't really specific to JUnit, but it does occur in JUnit. The problem is that JUnit doesn't add the path of junit.jar to the CLASSPATH. I think any java libraries should add themselves to CLASSPATH so that it's not as hard to compile on Archlinux. Currently I have to use `javac -cp $CLASSPATH:/usr/share/java/junit.jar TestFoo.java` in order to compile any test programs, and then the same to run them.

Proposed Solution:
Each library should add themselves to CLASSPATH by supplying a shell script in /etc/profile.d/ containing a line like "export CLASSPATH:$CLASSPATH:/usr/share/java/$pkgname.jar", or whatever path is appropriate. The Java Package Guidelines[1] seem to suggest the same.

I am not really all that familiar with CLASSPATH and java libraries in general, so there may be a downside to having everything in CLASSPATH, but it would be much less annoying.

Additional info:
* junit 4.4-1


Steps to reproduce:
Install junit and try to compile some test suite without altering the classpath

Note: Patch is not tested.

[1] http://wiki.archlinux.org/index.php/Java_Package_Guidelines
This task depends upon

Closed by  Jan de Groot (JGC)
Wednesday, 26 March 2008, 16:48 GMT
Reason for closing:  Won't implement
Comment by Jan de Groot (JGC) - Wednesday, 26 March 2008, 11:38 GMT
So we end up with a huge classpath on every jar installation. It's your own responsibility to include the classes you need.
What about eclipse-ecj, which is a java compiler, do we want that included in the classpath for each and every thing you do? Or the libgcj.jar file that includes the gcj java runtime libraries. Do you want that to be included when using sun java?

Loading...