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#5672 - Standardize JVM options for Java Packages

Attached to Project: Arch Linux
Opened by AqD (aquila_deus) - Thursday, 26 October 2006, 11:26 GMT
Last edited by Andreas Radke (AndyRTR) - Sunday, 14 June 2009, 20:54 GMT
Task Type Feature Request
Category System
Status Closed
Assigned To Jan de Groot (JGC)
Andreas Radke (AndyRTR)
Dan McGee (toofishes)
Architecture All
Severity Low
Priority Normal
Reported Version 0.7.2 Gimmick
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Hi!

It would be good if all java packages append an environment variable in JVM options, such as $JAVA_OPTS (used by ant and some other apps). It should be put to the end before -jar, to avoid being overrided.

Also, I have a small java wrapper that makes ps/top to show apps' original names instead of "java": (put to /usr/local/bin or somewhere to override the real java)

#################################################
if [ -z "${JAVA_APPNAME}" ]; then
JAVA_APPNAME="java"
fi
JAVA_HOME=/opt/java
JAVA_TMPDIR=/tmp/java-tmpdir-${UID}
mkdir -p ${JAVA_TMPDIR}/bin
ln -sfT ${JAVA_HOME}/jre ${JAVA_TMPDIR}/jre
ln -fT ${JAVA_HOME}/jre/bin/java ${JAVA_TMPDIR}/bin/$JAVA_APPNAME
exec ${JAVA_TMPDIR}/bin/$JAVA_APPNAME "$@"
#################################################

Packages that use binary launchers would need to be rewritten. Following is the script for eclipse:

APP_NAME=eclipse exec java -Xms256m -Xmx320m -XX:PermSize=64m -XX:MaxPermSize=128m -Djava.library.path=/usr/lib $JAVA_OPTS -jar /opt/eclipse/startup.jar -os linux -ws gtk -arch x86 -launcher /opt/eclipse/eclipse -name Eclipse -showsplash 600 -exitdata 4aeb003f -vm /opt/java/jre/bin/java -vmargs -jar /opt/eclipse/startup.jar
This task depends upon

Closed by  Andreas Radke (AndyRTR)
Sunday, 14 June 2009, 20:54 GMT
Reason for closing:  Won't implement
Comment by Jason Chu (jason) - Monday, 13 November 2006, 22:14 GMT
Can you help explain what/how JAVA_OPTS would be helpful?

Examples would be good.

I'm also not sure about changing the java name to be something other than what they say. Making changes to binary/package scripts though is probably fine.
Comment by Roman Kyrylych (Romashka) - Saturday, 09 February 2008, 14:46 GMT
status on this?
Comment by Greg (dolby) - Wednesday, 23 July 2008, 21:10 GMT
Aqd can you please give some more info on this?
Comment by AqD (aquila_deus) - Monday, 02 February 2009, 05:47 GMT
Hi! JAVA_OPTS can be used to force some options such as -Dswing.aatext=true and -Duser.language=en (UI language)

The naming could help a lot when you use ps/kill/etc, otherwise it's nearly impossible to script any process-related commands for java apps.
Comment by Aaron Griffin (phrakture) - Wednesday, 11 February 2009, 20:04 GMT
Adding some people who know what they're talking about WRT java

Opinions guys?
Comment by Gavin Bisesi (Daenyth) - Saturday, 21 March 2009, 14:08 GMT
What's the status on this?
Comment by Jan de Groot (JGC) - Sunday, 14 June 2009, 11:28 GMT
I don't see the need for a global JAVA_OPTS, as these options can be different per package. I'm using Debian on servers and don't see this implemented global either. Tomcat has its own JAVA_OPTS setting to pass additional flags to the java startup command.

Loading...