Can't remove environmental variable in Ubuntu 18.04How to set new value for existing environmental...

Theorems that impeded progress

Does an object always see its latest internal state irrespective of thread?

Is it unprofessional to ask if a job posting on GlassDoor is real?

Perform and show arithmetic with LuaLaTeX

Which country benefited the most from UN Security Council vetoes?

Is it inappropriate for a student to attend their mentor's dissertation defense?

Can I make popcorn with any corn?

What doth I be?

How does quantile regression compare to logistic regression with the variable split at the quantile?

What would happen to a modern skyscraper if it rains micro blackholes?

NMaximize is not converging to a solution

Convert two switches to a dual stack, and add outlet - possible here?

Why do I get two different answers for this counting problem?

Client team has low performances and low technical skills: we always fix their work and now they stop collaborate with us. How to solve?

Can I ask the recruiters in my resume to put the reason why I am rejected?

What's that red-plus icon near a text?

I'm flying to France today and my passport expires in less than 2 months

Did Shadowfax go to Valinor?

A newer friend of my brother's gave him a load of baseball cards that are supposedly extremely valuable. Is this a scam?

Why are electrically insulating heatsinks so rare? Is it just cost?

Do I have a twin with permutated remainders?

What is a clear way to write a bar that has an extra beat?

Unable to deploy metadata from Partner Developer scratch org because of extra fields

How do I deal with an unproductive colleague in a small company?



Can't remove environmental variable in Ubuntu 18.04


How to set new value for existing environmental variableHow to permanently set environmental variables PATH and M2_HOME in ubuntu for maven3?Editing the environment variableSetting JAVA environment variableNot able to 'unset' environmental variable permanently - UBUNTUWhere is my PATH variable being set?etc/environment == $PATH?PATH variable not getting updated according to /etc/environmentWhere JAVA_HOME is set?Ubuntu 18.04, cannot set LD_LIBRARY_PATH






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







1















I have set my environmental variable $JAVA_HOME within the /etc/environment file. Worked like a charm! Now I want to remove it. After removing the line completely from the environment file, then do a reboot, it continues to resolve the path on:



echo $JAVA_HOME



How do I clean that out?










share|improve this question































    1















    I have set my environmental variable $JAVA_HOME within the /etc/environment file. Worked like a charm! Now I want to remove it. After removing the line completely from the environment file, then do a reboot, it continues to resolve the path on:



    echo $JAVA_HOME



    How do I clean that out?










    share|improve this question



























      1












      1








      1








      I have set my environmental variable $JAVA_HOME within the /etc/environment file. Worked like a charm! Now I want to remove it. After removing the line completely from the environment file, then do a reboot, it continues to resolve the path on:



      echo $JAVA_HOME



      How do I clean that out?










      share|improve this question
















      I have set my environmental variable $JAVA_HOME within the /etc/environment file. Worked like a charm! Now I want to remove it. After removing the line completely from the environment file, then do a reboot, it continues to resolve the path on:



      echo $JAVA_HOME



      How do I clean that out?







      18.04 java environment-variables






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 4 mins ago









      WinEunuuchs2Unix

      47.4k1191183




      47.4k1191183










      asked 14 mins ago









      EddiefiggieEddiefiggie

      1814




      1814






















          1 Answer
          1






          active

          oldest

          votes


















          0














          The unset command will do this. From: Unix / Linux - Using Shell Variables




          Unsetting Variables



          Unsetting or deleting a variable directs the shell to remove the
          variable from the list of variables that it tracks. Once you unset a
          variable, you cannot access the stored value in the variable.



          Following is the syntax to unset a defined variable using the unset
          command −



          unset variable_name


          The above command unsets the value of a defined variable. Here is a
          simple example that demonstrates how the command works −



          #!/bin/sh

          NAME="Zara Ali"
          unset NAME
          echo $NAME





          share
























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "89"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1131571%2fcant-remove-environmental-variable-in-ubuntu-18-04%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            The unset command will do this. From: Unix / Linux - Using Shell Variables




            Unsetting Variables



            Unsetting or deleting a variable directs the shell to remove the
            variable from the list of variables that it tracks. Once you unset a
            variable, you cannot access the stored value in the variable.



            Following is the syntax to unset a defined variable using the unset
            command −



            unset variable_name


            The above command unsets the value of a defined variable. Here is a
            simple example that demonstrates how the command works −



            #!/bin/sh

            NAME="Zara Ali"
            unset NAME
            echo $NAME





            share




























              0














              The unset command will do this. From: Unix / Linux - Using Shell Variables




              Unsetting Variables



              Unsetting or deleting a variable directs the shell to remove the
              variable from the list of variables that it tracks. Once you unset a
              variable, you cannot access the stored value in the variable.



              Following is the syntax to unset a defined variable using the unset
              command −



              unset variable_name


              The above command unsets the value of a defined variable. Here is a
              simple example that demonstrates how the command works −



              #!/bin/sh

              NAME="Zara Ali"
              unset NAME
              echo $NAME





              share


























                0












                0








                0







                The unset command will do this. From: Unix / Linux - Using Shell Variables




                Unsetting Variables



                Unsetting or deleting a variable directs the shell to remove the
                variable from the list of variables that it tracks. Once you unset a
                variable, you cannot access the stored value in the variable.



                Following is the syntax to unset a defined variable using the unset
                command −



                unset variable_name


                The above command unsets the value of a defined variable. Here is a
                simple example that demonstrates how the command works −



                #!/bin/sh

                NAME="Zara Ali"
                unset NAME
                echo $NAME





                share













                The unset command will do this. From: Unix / Linux - Using Shell Variables




                Unsetting Variables



                Unsetting or deleting a variable directs the shell to remove the
                variable from the list of variables that it tracks. Once you unset a
                variable, you cannot access the stored value in the variable.



                Following is the syntax to unset a defined variable using the unset
                command −



                unset variable_name


                The above command unsets the value of a defined variable. Here is a
                simple example that demonstrates how the command works −



                #!/bin/sh

                NAME="Zara Ali"
                unset NAME
                echo $NAME






                share











                share


                share










                answered 6 mins ago









                WinEunuuchs2UnixWinEunuuchs2Unix

                47.4k1191183




                47.4k1191183






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Ask Ubuntu!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1131571%2fcant-remove-environmental-variable-in-ubuntu-18-04%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Why do type traits not work with types in namespace scope?What are POD types in C++?Why can templates only be...

                    Will tsunami waves travel forever if there was no land?Why do tsunami waves begin with the water flowing away...

                    Should I use Docker or LXD?How to cache (more) data on SSD/RAM to avoid spin up?Unable to get Windows File...