Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 316973 - jetty.sh claims java installation is invalid
Summary: jetty.sh claims java installation is invalid
Status: CLOSED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: other (show other bugs)
Version: 7.1.4   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: 7.1.x   Edit
Assignee: Joakim Erdfelt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-15 16:41 EDT by Barry Pearce CLA
Modified: 2010-06-16 16:56 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Barry Pearce CLA 2010-06-15 16:41:49 EDT
Build Identifier: jetty-hightide-7.1.4.v20100610.tar.gz

Ubuntu Karmic Koala 9.10 fully updated. Sun java 6 packages.
7.1.3 works fine. 
Having fixed #316970 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=316970)
7.1.4 fails now fails with '** ERROR: Java installation at '/usr/bin/java' doesn't appear to be valid or complete.'.

The jdk package is complete and valid. 7.1.3 ran without fail.

The script fails unless JAVA_HOME is set.


Reproducible: Always

Steps to Reproduce:
1.service jetty start

or 

1. service jetty check
Comment 1 Joakim Erdfelt CLA 2010-06-15 17:31:51 EDT
JAVA_HOME is required, as Jetty requires a Java JDK (not JRE).
Comment 2 Joakim Erdfelt CLA 2010-06-15 17:41:39 EDT
Additional update.

Jetty-hightide 7.1.3 had a broken jetty.sh on many non-ubuntu systems (mainly due to a build bug on the hightide side not keeping its jetty.sh up to date with the one from jetty-distribution).  The correct (and most up to date) jetty.sh from jetty-distribution is now being used with jetty-hightide-7.1.4 onwards.
Comment 3 Joakim Erdfelt CLA 2010-06-15 18:02:09 EDT
When investigating this JAVA_HOME requirement, it appears tied to the JSP pieces of Jetty.
Comment 4 Barry Pearce CLA 2010-06-16 04:54:39 EDT
Hi,

I dont use JSP.

Whilst I understand perfectly the jdk vs jre comment the jetty.sh has 'auto-locating' code in it. In 7.1.3 this works. In 7.1.4 it fails. The code has been altered between releases.

I have reverted to using the 7.1.3 script on a 7.1.4 install and everything works fine.

I have a JDK installed - it is the ubuntu package.

There is little point in having autolocating code if the requirement is you must specify JAVA_HOME in /etc/default/jetty.

So the fix should be either:
1. Fix the auto-locating code to work on Ubuntu systems.
or
2. Remove the auto-locating code altogether and force specification of JAVA_HOME by everyone thus eliminating potential problems of the auto-locating code.

I vote for 1.
Comment 5 Joakim Erdfelt CLA 2010-06-16 16:55:47 EDT
Fixed in trunk r2017

New jetty.sh does not check for JAVA_HOME.
It will use optional JAVA variable (if provided)
If JAVA is not set, then a $(which java) will be used to find java in the search PATH.
Comment 6 Joakim Erdfelt CLA 2010-06-16 16:56:03 EDT
Marking closed.