Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0016684Openbravo ERPA. Platformpublic2011-04-07 12:462011-05-31 11:51
HexDump 
jpabloae 
normalminoralways
closedfixed 
20Community Appliance
 
3.0RC7 
Core
No
0016684: Test for JAVA_HOME should be placed after root test is done in build.xml
<target name="init" depends="code.rev">
    <fail if="no.java.home" message="The environment variable JAVA_HOME is not $
    <fail if="root.user" message="Don't run ant tasks with the root user" />
</target>

This should be set as:

<target name="init" depends="code.rev">
    <fail if="root.user" message="Don't run ant tasks with the root user" />
    <fail if="no.java.home" message="The environment variable JAVA_HOME is not $
</target>

The problem here are environment vars. On ubuntu I had my java_home, etc... in /etc/environment. This seems not to be exported when going super user, so, I was getting an error saying that JAVA_HOME was not set, but it would have been much more better to flag that root account should not be used.

No tags attached.
depends on backport 0016685 closed jpabloae Test for JAVA_HOME should be placed after root test is done in build.xml 
Issue History
2011-04-07 12:46HexDumpNew Issue
2011-04-07 12:46HexDumpAssigned To => adrianromero
2011-04-07 12:46HexDumpModules => Core
2011-04-07 12:48iperdomoAssigned Toadrianromero => iperdomo
2011-04-07 12:48iperdomoCategory08. Project and service management => A. Platform
2011-04-07 12:49iperdomoStatusnew => scheduled
2011-04-07 12:49iperdomofix_in_branch => pi
2011-04-07 12:51iperdomoAssigned Toiperdomo => jpabloae
2011-04-07 12:56hgbotCheckin
2011-04-07 12:56hgbotNote Added: 0035729
2011-04-07 12:56hgbotStatusscheduled => resolved
2011-04-07 12:56hgbotResolutionopen => fixed
2011-04-07 12:56hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/e2556cfac1b64d6b0d2195932e815d817e498dab [^]
2011-04-07 12:57jpabloaeNote Added: 0035730
2011-05-31 11:51gorka_gilNote Added: 0037819
2011-05-31 11:51gorka_gilStatusresolved => closed
2011-05-31 11:51gorka_gilFixed in Version => 3.0RC7

Notes
(0035729)
hgbot   
2011-04-07 12:56   
Repository: erp/devel/pi
Changeset: e2556cfac1b64d6b0d2195932e815d817e498dab
Author: Juan Pablo Aroztegi <juanpablo.aroztegi <at> openbravo.com>
Date: Thu Apr 07 12:54:22 2011 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/e2556cfac1b64d6b0d2195932e815d817e498dab [^]

Fixes 16684: swap the order in the root.user and no.java.home checks.

Some Linux systems don't have JAVA_HOME set for the root user.
When a user runs ant commands in these cases they get an
error about the JAVA_HOME not being set, but the real cause
is that they're running the command as root. Hence the order
swapping.

---
M build.xml
---
(0035730)
jpabloae   
2011-04-07 12:57   
Thank you HexDump for the bug report and the proposed solution. It makes sense.
(0037819)
gorka_gil   
2011-05-31 11:51   
Verified.