You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Michael Bieniosek (JIRA)" <ji...@apache.org> on 2007/03/13 01:20:09 UTC

[jira] Created: (HADOOP-1114) bin/hadoop script clobbers CLASSPATH

bin/hadoop script clobbers CLASSPATH
------------------------------------

                 Key: HADOOP-1114
                 URL: https://issues.apache.org/jira/browse/HADOOP-1114
             Project: Hadoop
          Issue Type: Bug
          Components: scripts
    Affects Versions: 0.12.0
            Reporter: Michael Bieniosek
            Priority: Minor


The bin/hadoop script distributed with hadoop clobbers the user's CLASSPATH.  This prevents ad-hoc appending to the CLASSPATH.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-1114) bin/hadoop script clobbers CLASSPATH

Posted by "Michael Bieniosek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-1114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12488196 ] 

Michael Bieniosek commented on HADOOP-1114:
-------------------------------------------

Yes, that works for me.

> bin/hadoop script clobbers CLASSPATH
> ------------------------------------
>
>                 Key: HADOOP-1114
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1114
>             Project: Hadoop
>          Issue Type: Bug
>          Components: scripts
>    Affects Versions: 0.12.0
>            Reporter: Michael Bieniosek
>            Priority: Minor
>             Fix For: 0.13.0
>
>         Attachments: HADOOP-1114.patch, hadoop-no-clobber-classpath.patch
>
>
> The bin/hadoop script distributed with hadoop clobbers the user's CLASSPATH.  This prevents ad-hoc appending to the CLASSPATH.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-1114) bin/hadoop script clobbers CLASSPATH

Posted by "Michael Bieniosek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-1114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12487279 ] 

Michael Bieniosek commented on HADOOP-1114:
-------------------------------------------

I don't think it matters; if you set your classpath to ::::::::::/somejar.jar I think java will still do the right thing.



> bin/hadoop script clobbers CLASSPATH
> ------------------------------------
>
>                 Key: HADOOP-1114
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1114
>             Project: Hadoop
>          Issue Type: Bug
>          Components: scripts
>    Affects Versions: 0.12.0
>            Reporter: Michael Bieniosek
>            Priority: Minor
>         Attachments: hadoop-no-clobber-classpath.patch
>
>
> The bin/hadoop script distributed with hadoop clobbers the user's CLASSPATH.  This prevents ad-hoc appending to the CLASSPATH.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HADOOP-1114) bin/hadoop script clobbers CLASSPATH

Posted by "Michael Bieniosek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-1114?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Bieniosek updated HADOOP-1114:
--------------------------------------

    Status: Patch Available  (was: Open)

> bin/hadoop script clobbers CLASSPATH
> ------------------------------------
>
>                 Key: HADOOP-1114
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1114
>             Project: Hadoop
>          Issue Type: Bug
>          Components: scripts
>    Affects Versions: 0.12.0
>            Reporter: Michael Bieniosek
>            Priority: Minor
>
> The bin/hadoop script distributed with hadoop clobbers the user's CLASSPATH.  This prevents ad-hoc appending to the CLASSPATH.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HADOOP-1114) bin/hadoop script clobbers CLASSPATH

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-1114?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doug Cutting updated HADOOP-1114:
---------------------------------

    Attachment: HADOOP-1114.patch

Here's a patch that implements HADOOP_CLASSPATH.

Michael, is this acceptable to you?

> bin/hadoop script clobbers CLASSPATH
> ------------------------------------
>
>                 Key: HADOOP-1114
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1114
>             Project: Hadoop
>          Issue Type: Bug
>          Components: scripts
>    Affects Versions: 0.12.0
>            Reporter: Michael Bieniosek
>            Priority: Minor
>             Fix For: 0.13.0
>
>         Attachments: HADOOP-1114.patch, hadoop-no-clobber-classpath.patch
>
>
> The bin/hadoop script distributed with hadoop clobbers the user's CLASSPATH.  This prevents ad-hoc appending to the CLASSPATH.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-1114) bin/hadoop script clobbers CLASSPATH

Posted by "Michael Bieniosek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-1114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12480234 ] 

Michael Bieniosek commented on HADOOP-1114:
-------------------------------------------

Here's my proposed patch:

--- bin/hadoop.orig
+++ bin/hadoop
@@ -74,7 +74,8 @@
 fi
 
 # CLASSPATH initially contains $HADOOP_CONF_DIR
-CLASSPATH="${HADOOP_CONF_DIR}"
+# respect previously set CLASSPATH
+CLASSPATH="$CLASSPATH:${HADOOP_CONF_DIR}"
 CLASSPATH=${CLASSPATH}:$JAVA_HOME/lib/tools.jar
 
 # for developers, add Hadoop classes to CLASSPATH

> bin/hadoop script clobbers CLASSPATH
> ------------------------------------
>
>                 Key: HADOOP-1114
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1114
>             Project: Hadoop
>          Issue Type: Bug
>          Components: scripts
>    Affects Versions: 0.12.0
>            Reporter: Michael Bieniosek
>            Priority: Minor
>
> The bin/hadoop script distributed with hadoop clobbers the user's CLASSPATH.  This prevents ad-hoc appending to the CLASSPATH.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-1114) bin/hadoop script clobbers CLASSPATH

Posted by "Michael Bieniosek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-1114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12487917 ] 

Michael Bieniosek commented on HADOOP-1114:
-------------------------------------------

We have a separate mechanism to distribute generic software; this is what we currently use to distribute jar dependencies.  Currently our hadoop jars also depend on non-java code which can't be distributed via jar.  So we could package all our java code into a single jar (we would just need to write a combine-jar tool).  But this wouldn't solve our problem, because some of our code wouldn't go in the jar and would still have to be distributed through a different mechanism.  I'd rather be supporting one software distribution system than two.


> bin/hadoop script clobbers CLASSPATH
> ------------------------------------
>
>                 Key: HADOOP-1114
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1114
>             Project: Hadoop
>          Issue Type: Bug
>          Components: scripts
>    Affects Versions: 0.12.0
>            Reporter: Michael Bieniosek
>            Priority: Minor
>             Fix For: 0.13.0
>
>         Attachments: hadoop-no-clobber-classpath.patch
>
>
> The bin/hadoop script distributed with hadoop clobbers the user's CLASSPATH.  This prevents ad-hoc appending to the CLASSPATH.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-1114) bin/hadoop script clobbers CLASSPATH

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-1114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12487921 ] 

Doug Cutting commented on HADOOP-1114:
--------------------------------------

> Currently our hadoop jars also depend on non-java code which can't be distributed via jar.

Job jar files are unpacked in the directory where the job jvm is run, so non-java data and code in the jar file can be easily accessed via relative paths.

> we would just need to write a combine-jar tool

Ant has good tools for constructing jar files.

In any case, if you like to install all your software in a separate directory, and want parts of it to appear on the classpath of the Hadoop daemons, that's fine.  I just think our scripts should not rely on the overused CLASSPATH environment variable, but would be less fragile if they use HADOOP_CLASSPATH.


> bin/hadoop script clobbers CLASSPATH
> ------------------------------------
>
>                 Key: HADOOP-1114
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1114
>             Project: Hadoop
>          Issue Type: Bug
>          Components: scripts
>    Affects Versions: 0.12.0
>            Reporter: Michael Bieniosek
>            Priority: Minor
>             Fix For: 0.13.0
>
>         Attachments: hadoop-no-clobber-classpath.patch
>
>
> The bin/hadoop script distributed with hadoop clobbers the user's CLASSPATH.  This prevents ad-hoc appending to the CLASSPATH.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-1114) bin/hadoop script clobbers CLASSPATH

Posted by "Tom White (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-1114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12487171 ] 

Tom White commented on HADOOP-1114:
-----------------------------------

Should this check to see if CLASSPATH has been previously set before including it in the new CLASSPATH? 

> bin/hadoop script clobbers CLASSPATH
> ------------------------------------
>
>                 Key: HADOOP-1114
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1114
>             Project: Hadoop
>          Issue Type: Bug
>          Components: scripts
>    Affects Versions: 0.12.0
>            Reporter: Michael Bieniosek
>            Priority: Minor
>         Attachments: hadoop-no-clobber-classpath.patch
>
>
> The bin/hadoop script distributed with hadoop clobbers the user's CLASSPATH.  This prevents ad-hoc appending to the CLASSPATH.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (HADOOP-1114) bin/hadoop script clobbers CLASSPATH

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-1114?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doug Cutting reopened HADOOP-1114:
----------------------------------

      Assignee: Doug Cutting

> bin/hadoop script clobbers CLASSPATH
> ------------------------------------
>
>                 Key: HADOOP-1114
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1114
>             Project: Hadoop
>          Issue Type: Bug
>          Components: scripts
>    Affects Versions: 0.12.0
>            Reporter: Michael Bieniosek
>         Assigned To: Doug Cutting
>            Priority: Minor
>             Fix For: 0.13.0
>
>         Attachments: HADOOP-1114.patch, hadoop-no-clobber-classpath.patch
>
>
> The bin/hadoop script distributed with hadoop clobbers the user's CLASSPATH.  This prevents ad-hoc appending to the CLASSPATH.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-1114) bin/hadoop script clobbers CLASSPATH

Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-1114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12487752 ] 

Hadoop QA commented on HADOOP-1114:
-----------------------------------

Integrated in Hadoop-Nightly #53 (See http://lucene.zones.apache.org:8080/hudson/job/Hadoop-Nightly/53/)

> bin/hadoop script clobbers CLASSPATH
> ------------------------------------
>
>                 Key: HADOOP-1114
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1114
>             Project: Hadoop
>          Issue Type: Bug
>          Components: scripts
>    Affects Versions: 0.12.0
>            Reporter: Michael Bieniosek
>            Priority: Minor
>             Fix For: 0.13.0
>
>         Attachments: hadoop-no-clobber-classpath.patch
>
>
> The bin/hadoop script distributed with hadoop clobbers the user's CLASSPATH.  This prevents ad-hoc appending to the CLASSPATH.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-1114) bin/hadoop script clobbers CLASSPATH

Posted by "Michael Bieniosek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-1114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12487857 ] 

Michael Bieniosek commented on HADOOP-1114:
-------------------------------------------

Currently, the hadoop runjar commands takes a single user jar as argument.  However, our jar depends on other (custom) java libraries.  So we get around this by this CLASSPATH hack.  We could drop dependent jars into the hadoop lib file, but I'd rather not mix shipped hadoop code with our user code.

We could package all the dependent code into the same jar, but that seems unnecessary.  A better alternative might be to set a CLASSPATH in the jar manifest, but I haven't thought very much about how that would work.

So unless there is another better yet simple method, we need some way to insert jar dependencies into hadoop.  Your example of Tomcat is a bit different, since there is a well-defined mechanism for getting dependent jars into servlet containers (using the WEB-INF/lib directory). 

It doesn't seem very worthwhile to rename CLASSPATH to HADOOP_CLASSPATH.  


> bin/hadoop script clobbers CLASSPATH
> ------------------------------------
>
>                 Key: HADOOP-1114
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1114
>             Project: Hadoop
>          Issue Type: Bug
>          Components: scripts
>    Affects Versions: 0.12.0
>            Reporter: Michael Bieniosek
>            Priority: Minor
>             Fix For: 0.13.0
>
>         Attachments: hadoop-no-clobber-classpath.patch
>
>
> The bin/hadoop script distributed with hadoop clobbers the user's CLASSPATH.  This prevents ad-hoc appending to the CLASSPATH.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-1114) bin/hadoop script clobbers CLASSPATH

Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-1114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12488214 ] 

Hadoop QA commented on HADOOP-1114:
-----------------------------------

-1, could not apply patch.

The patch command could not apply the latest attachment http://issues.apache.org/jira/secure/attachment/12355371/HADOOP-1114.patch as a patch to trunk revision r527711.

Test results:   http://lucene.zones.apache.org:8080/hudson/job/Hadoop-Patch/30/testReport/
Console output: http://lucene.zones.apache.org:8080/hudson/job/Hadoop-Patch/30/console

Please note that this message is automatically generated and may represent a problem with the automation system and not the patch.

> bin/hadoop script clobbers CLASSPATH
> ------------------------------------
>
>                 Key: HADOOP-1114
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1114
>             Project: Hadoop
>          Issue Type: Bug
>          Components: scripts
>    Affects Versions: 0.12.0
>            Reporter: Michael Bieniosek
>         Assigned To: Doug Cutting
>            Priority: Minor
>             Fix For: 0.13.0
>
>         Attachments: HADOOP-1114.patch, hadoop-no-clobber-classpath.patch
>
>
> The bin/hadoop script distributed with hadoop clobbers the user's CLASSPATH.  This prevents ad-hoc appending to the CLASSPATH.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-1114) bin/hadoop script clobbers CLASSPATH

Posted by "Tom White (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-1114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12488178 ] 

Tom White commented on HADOOP-1114:
-----------------------------------

I would vote for HADOOP_CLASSPATH over plain CLASSPATH. This solves Michael's problem, while avoiding hard-to-diagnose support issues that might arise in the future from junk on the standard CLASSPATH.

> bin/hadoop script clobbers CLASSPATH
> ------------------------------------
>
>                 Key: HADOOP-1114
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1114
>             Project: Hadoop
>          Issue Type: Bug
>          Components: scripts
>    Affects Versions: 0.12.0
>            Reporter: Michael Bieniosek
>            Priority: Minor
>             Fix For: 0.13.0
>
>         Attachments: hadoop-no-clobber-classpath.patch
>
>
> The bin/hadoop script distributed with hadoop clobbers the user's CLASSPATH.  This prevents ad-hoc appending to the CLASSPATH.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HADOOP-1114) bin/hadoop script clobbers CLASSPATH

Posted by "Tom White (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-1114?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tom White updated HADOOP-1114:
------------------------------

       Resolution: Fixed
    Fix Version/s: 0.13.0
           Status: Resolved  (was: Patch Available)

Yes, I just tried it and this change works when the user's classpath variable is unset. 

I've just committed this. Thanks Michael!

> bin/hadoop script clobbers CLASSPATH
> ------------------------------------
>
>                 Key: HADOOP-1114
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1114
>             Project: Hadoop
>          Issue Type: Bug
>          Components: scripts
>    Affects Versions: 0.12.0
>            Reporter: Michael Bieniosek
>            Priority: Minor
>             Fix For: 0.13.0
>
>         Attachments: hadoop-no-clobber-classpath.patch
>
>
> The bin/hadoop script distributed with hadoop clobbers the user's CLASSPATH.  This prevents ad-hoc appending to the CLASSPATH.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HADOOP-1114) bin/hadoop script clobbers CLASSPATH

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-1114?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doug Cutting updated HADOOP-1114:
---------------------------------

    Resolution: Fixed
        Status: Resolved  (was: Patch Available)

I just committed this.

> bin/hadoop script clobbers CLASSPATH
> ------------------------------------
>
>                 Key: HADOOP-1114
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1114
>             Project: Hadoop
>          Issue Type: Bug
>          Components: scripts
>    Affects Versions: 0.12.0
>            Reporter: Michael Bieniosek
>         Assigned To: Doug Cutting
>            Priority: Minor
>             Fix For: 0.13.0
>
>         Attachments: HADOOP-1114.patch, hadoop-no-clobber-classpath.patch
>
>
> The bin/hadoop script distributed with hadoop clobbers the user's CLASSPATH.  This prevents ad-hoc appending to the CLASSPATH.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-1114) bin/hadoop script clobbers CLASSPATH

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-1114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12487930 ] 

Doug Cutting commented on HADOOP-1114:
--------------------------------------

> I accept that using CLASSPATH for dependencies is fragile and hacky, I'm not sure why HADOOP_CLASSPATH is any different.

It's a bit less fragile, since it won't conflict with every other Java application in the world, only with other Hadoop-based applications.  That's all.  For example, I've seen Windows installers that set CLASSPATH to include lots of stuff that we wouldn't want on Hadoop's class path.

> bin/hadoop script clobbers CLASSPATH
> ------------------------------------
>
>                 Key: HADOOP-1114
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1114
>             Project: Hadoop
>          Issue Type: Bug
>          Components: scripts
>    Affects Versions: 0.12.0
>            Reporter: Michael Bieniosek
>            Priority: Minor
>             Fix For: 0.13.0
>
>         Attachments: hadoop-no-clobber-classpath.patch
>
>
> The bin/hadoop script distributed with hadoop clobbers the user's CLASSPATH.  This prevents ad-hoc appending to the CLASSPATH.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-1114) bin/hadoop script clobbers CLASSPATH

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-1114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12487907 ] 

Doug Cutting commented on HADOOP-1114:
--------------------------------------

> We could package all the dependent code into the same jar, but that seems unnecessary.

Why is this unnecessary?  That's the intended mechanism.  Job jars may include a lib/ directory with other jar files, just like a war file.  Packaging things this way makes it much easier to update your code without restarting Hadoop daemons.


> bin/hadoop script clobbers CLASSPATH
> ------------------------------------
>
>                 Key: HADOOP-1114
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1114
>             Project: Hadoop
>          Issue Type: Bug
>          Components: scripts
>    Affects Versions: 0.12.0
>            Reporter: Michael Bieniosek
>            Priority: Minor
>             Fix For: 0.13.0
>
>         Attachments: hadoop-no-clobber-classpath.patch
>
>
> The bin/hadoop script distributed with hadoop clobbers the user's CLASSPATH.  This prevents ad-hoc appending to the CLASSPATH.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-1114) bin/hadoop script clobbers CLASSPATH

Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-1114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12488339 ] 

Hadoop QA commented on HADOOP-1114:
-----------------------------------

Integrated in Hadoop-Nightly #55 (See http://lucene.zones.apache.org:8080/hudson/job/Hadoop-Nightly/55/)

> bin/hadoop script clobbers CLASSPATH
> ------------------------------------
>
>                 Key: HADOOP-1114
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1114
>             Project: Hadoop
>          Issue Type: Bug
>          Components: scripts
>    Affects Versions: 0.12.0
>            Reporter: Michael Bieniosek
>         Assigned To: Doug Cutting
>            Priority: Minor
>             Fix For: 0.13.0
>
>         Attachments: HADOOP-1114.patch, hadoop-no-clobber-classpath.patch
>
>
> The bin/hadoop script distributed with hadoop clobbers the user's CLASSPATH.  This prevents ad-hoc appending to the CLASSPATH.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-1114) bin/hadoop script clobbers CLASSPATH

Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-1114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12486722 ] 

Hadoop QA commented on HADOOP-1114:
-----------------------------------

-1, because the patch command could not apply the latest attachment http://issues.apache.org as a patch to trunk revision http://svn.apache.org/repos/asf/lucene/hadoop/trunk/525505. Please note that this message is automatically generated and may represent a problem with the automation system and not the patch. Results are at http://lucene.zones.apache.org:8080/hudson/job/Hadoop-Patch

> bin/hadoop script clobbers CLASSPATH
> ------------------------------------
>
>                 Key: HADOOP-1114
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1114
>             Project: Hadoop
>          Issue Type: Bug
>          Components: scripts
>    Affects Versions: 0.12.0
>            Reporter: Michael Bieniosek
>            Priority: Minor
>         Attachments: hadoop-no-clobber-classpath.patch
>
>
> The bin/hadoop script distributed with hadoop clobbers the user's CLASSPATH.  This prevents ad-hoc appending to the CLASSPATH.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-1114) bin/hadoop script clobbers CLASSPATH

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-1114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12487817 ] 

Doug Cutting commented on HADOOP-1114:
--------------------------------------

Sorry.  I'm coming to this rather late.  But, for what it's worth, the prior behavior was intentional.  The CLASSPATH environment variable is fragile to use.  Folks can end up with lots of crazy stuff on it (e.g., conflicting versions of libraries) that can break things in confusing ways.  Thus it's generally better to not rely on it.

Sun subtly discourages using the CLASSPATH environment variable:

http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/classpath.html#env%20var

Tomcat's startup scripts erase any pre-existing CLASSPATH values:

http://svn.apache.org/repos/asf/tomcat/container/tc5.5.x/catalina/src/bin/setclasspath.sh

However, Ant does respect it:

http://svn.apache.org/viewvc/ant/core/trunk/src/script/ant?view=markup

To add things to Hadoop's classpath one can simply add files to Hadoop's lib directory (as folks typically add junit's jar to ant's lib).  If that's insufficient, I'd rather we add a HADOOP_CLASSPATH environment variable than use the fragile, global CLASSPATH.

What do others think?

> bin/hadoop script clobbers CLASSPATH
> ------------------------------------
>
>                 Key: HADOOP-1114
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1114
>             Project: Hadoop
>          Issue Type: Bug
>          Components: scripts
>    Affects Versions: 0.12.0
>            Reporter: Michael Bieniosek
>            Priority: Minor
>             Fix For: 0.13.0
>
>         Attachments: hadoop-no-clobber-classpath.patch
>
>
> The bin/hadoop script distributed with hadoop clobbers the user's CLASSPATH.  This prevents ad-hoc appending to the CLASSPATH.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HADOOP-1114) bin/hadoop script clobbers CLASSPATH

Posted by "Michael Bieniosek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-1114?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Bieniosek updated HADOOP-1114:
--------------------------------------

    Attachment: hadoop-no-clobber-classpath.patch

> bin/hadoop script clobbers CLASSPATH
> ------------------------------------
>
>                 Key: HADOOP-1114
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1114
>             Project: Hadoop
>          Issue Type: Bug
>          Components: scripts
>    Affects Versions: 0.12.0
>            Reporter: Michael Bieniosek
>            Priority: Minor
>         Attachments: hadoop-no-clobber-classpath.patch
>
>
> The bin/hadoop script distributed with hadoop clobbers the user's CLASSPATH.  This prevents ad-hoc appending to the CLASSPATH.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-1114) bin/hadoop script clobbers CLASSPATH

Posted by "Michael Bieniosek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-1114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12487926 ] 

Michael Bieniosek commented on HADOOP-1114:
-------------------------------------------

While I accept that using CLASSPATH for dependencies is fragile and hacky, I'm not sure why HADOOP_CLASSPATH is any different.  It seems both environment variables are equally abusable.  Using CLASSPATH is much more intuitive than the nonstandard HADOOP_CLASSPATH.  The only problem that HADOOP_CLASSPATH seems to solve is that a caller script might leave inherited garbage in CLASSPATH before adding more jars.  But that should be the responsibility of the caller script, I think.

> bin/hadoop script clobbers CLASSPATH
> ------------------------------------
>
>                 Key: HADOOP-1114
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1114
>             Project: Hadoop
>          Issue Type: Bug
>          Components: scripts
>    Affects Versions: 0.12.0
>            Reporter: Michael Bieniosek
>            Priority: Minor
>             Fix For: 0.13.0
>
>         Attachments: hadoop-no-clobber-classpath.patch
>
>
> The bin/hadoop script distributed with hadoop clobbers the user's CLASSPATH.  This prevents ad-hoc appending to the CLASSPATH.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HADOOP-1114) bin/hadoop script clobbers CLASSPATH

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-1114?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doug Cutting updated HADOOP-1114:
---------------------------------

    Status: Patch Available  (was: Reopened)

> bin/hadoop script clobbers CLASSPATH
> ------------------------------------
>
>                 Key: HADOOP-1114
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1114
>             Project: Hadoop
>          Issue Type: Bug
>          Components: scripts
>    Affects Versions: 0.12.0
>            Reporter: Michael Bieniosek
>         Assigned To: Doug Cutting
>            Priority: Minor
>             Fix For: 0.13.0
>
>         Attachments: HADOOP-1114.patch, hadoop-no-clobber-classpath.patch
>
>
> The bin/hadoop script distributed with hadoop clobbers the user's CLASSPATH.  This prevents ad-hoc appending to the CLASSPATH.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.