Vuze won't launch if default Java is not Java 6

Bug #296880 reported by Travis B. Hartwell
38
This bug affects 2 people
Affects Status Importance Assigned to Milestone
azureus (Ubuntu)
Fix Released
Medium
Adrian Perez
Nominated for Intrepid by Stefano Maioli

Bug Description

Binary package hint: azureus

The azureus package depends on default-jre, which is java 6 on Interpid. The code is compiled with a Java 6 compiler. But, I have my system /usr/bin/java set to Java 5 via the alternatives mechanism. Launching Vuze from the menu silently fails. Launching it from a terminal shows that there is a wrong class file version. I fixed this by copying /usr/bin/vuze, editing the line that sets the java environment variable to point specifically to the java 6 version and then setting the JAVA_HOME appropriately in the terminal where I launched vuze.

If Vuze depends on Java 6, you should probably hard code the path of the Java 6 JRE/JDK in the shell script to launch it.

Attached is a patch of what I did to the shell script to get it to launch.

Revision history for this message
Travis B. Hartwell (nafai) wrote :
Revision history for this message
John Dong (jdong) wrote :

I think it's time for us to bite the bullet and do this... We are pretty sure that only OpenJDK6 and Sun Java6 run Azureus correctly. I think if we compile with class compatibility with Java 1.5 we can get sun-java5 working too.

Stefano and I talked a bit about this before, I think we should hardcode the launcher to prefer OpenJDK6, then sun-java6, then if both are not present then we respect the /usr/bin/java symlink. In addition, we should add an AZUREUS_FORCE_JAVA type of environment variable to respect /usr/bin/java no matter what.

Changed in azureus:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
goto (gotolaunchpad) wrote :

Is there any progress regarding this bug?
Is it already fixed? On http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=495514 seem to exist patches for the wanted behaviour.

Stefano Maioli (smaioli)
Changed in azureus:
assignee: nobody → smaioli
status: Triaged → In Progress
Revision history for this message
Stefano Maioli (smaioli) wrote :

@John: I propose implementing your suggested fix only in the Intrepid SRU, leaving the startup script in Jaunty the way it is. Otherwise when new java versions will come out things will break (it will be the time for jdk 7 sooner or later). After all, since we will depend on java6-runtime, a java6 jre will be the default unless a user decided to call update-alternatives himself.

Revision history for this message
Aldrin Martoq (amartoq) wrote :

I've updated from 8.10 to 9.04, now vuze/azureus is not working.

The /usr/bin/azureus script has /usr/lib/jvm/java-6-openjdk/jre/bin/java hardwired, but I don't have java6 installed in my machine only sun-java5-*. If I change the script, I got the "class version" problem.

Please fix the script (It's harwired to openjdk) and fix the dependencies, so updates don't break and make the package unusable. Current in azures is:
Depends: openjdk-6-jre | sun-java5-jre | sun-java6-jre, libcommons-cli-java, liblog4j1.2-java, libswt-gtk-3.4-java

Thanks,

Revision history for this message
Wilbert Volkers (wilbertvolkers) wrote :

I've also updated from 8.10 to 9.04, and i have java6 installed. It will still not work because the path to the java executable has changed. To fix it:

$ sudo gedit /usr/bin/azureus

change

JAVA='/usr/lib/jvm/java-6-openjdk/jre/bin/java -Xmx1024M'

to

JAVA='/usr/lib/jvm/java-6-sun/jre/bin/java -Xmx1024M'

Revision history for this message
fiXedd (jeremy-logan) wrote :

Implementing John's proposed fix would have been ideal. However, what happened was that it was made to depend on one of "openjdk-6-jre | sun-java5-jre | sun-java6-jre" where as the script will only actually allow one of those to work. Even something like the following would be better (though still not ideal since it doesn't respect preferences):

if [ -f /usr/lib/jvm/java-6-openjdk/jre/bin/java ]; then
 JAVA='/usr/lib/jvm/java-6-openjdk/jre/bin/java -Xmx1024M'
else
 if [ -f /usr/lib/jvm/java-6-sun/jre/bin/java ]; then
  JAVA='/usr/lib/jvm/java-6-sun/jre/bin/java -Xmx1024M'
 else
  JAVA='/usr/bin/java -Xmx1024M'
 fi
fi

Revision history for this message
wensveen (wensveen) wrote :

Why not use the /etc/alternatives system for this? When the dependencies have been set to only allow java versions higher than (or equal to) version 6, this poses no problem, does it?

Revision history for this message
Aldrin Martoq (amartoq) wrote :

@wensveen: If I understand correctly, your proposition doesn't fix the bug. I have installed both sun-java-5-* and openjdk-6-jre, and my java preference is set to java5.

My proposal is:
1.- Remove sun-java5-jre from dependencies, since it is simply wrong.
2.- As a temporal fix, either:
-- Remove sun-java6-jre form dependencies, leave opendjk6-jre and the script will work as it is
-- Leave openjdk6-jre | sun-java6-jre as dependencies but fix the script, as @fiXedd proposal or something that "respects" the /etc/alternatives (only if the user choosed a java6 jre).

Revision history for this message
wensveen (wensveen) wrote :

@Aldrin: Yes, you're right. Hmm, I guess it's not possible to have the dependencies conflict with all java runtimes below java 6. Or at least, this would be undesirable.

At the very least Aldrin's 1st suggestion should be done. It is indeed simply *wrong*. When we also depend on 'openjdk-6-jre | sun-java6-jre', fiXedd script is okay, because we know at least one of them is installed. A more complicated, but also more correct option would be to first check /etc/alternatives, and when that results in a java version below 6, fall back to fiXedd script.

Actually, /etc/alternatives/java is kind of incorrect, IMO. Because java5 and java6 are seperate products, and it is completely viable to run them alongside each other, there should be an /etc/alternatives/java5 and /etc/alternatives/java6 (../java7). At least for versions that are not completely compatible.

Stefano Maioli (smaioli)
Changed in azureus (Ubuntu):
assignee: Stefano Maioli (smaioli) → nobody
status: In Progress → Confirmed
Revision history for this message
Adrian Perez (adrianperez-deb) wrote :

Hello everybody.
The use of java-wrappers in the azureus launcher since version 4.2.0.4-1 has solved most of the issues I've seen in this post. Azureus is reported to run only on sun's or openjdk jvm, according to upstream devs.
That's why I don't use alternatives, but the launcher script should be able to detect and set settings for sun (at least 5) or openjdk.
Please report if you think it runs properly in another JVM.

Revision history for this message
Adrian Perez (adrianperez-deb) wrote :

Since 4.2.0.4-1 (now in karmic), has been fixed.

Changed in azureus (Ubuntu):
assignee: nobody → Adrian Perez (adrianperez-deb)
status: Confirmed → Fix Committed
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.