switchon@lavalamp.biz
+27(0) 83 419 4851 / +27(0) 21 036 1165
Application & software development
Get A Quote

    • Home
    • Services
      • Application & software development
      • Outsourced software development
      • Project based resourcing
      • Digital marketing & consulting
      • Graphic design & consulting
      • UI / UX design & consulting
      • Recruitment services
      • Lease an expert
    • About
      • How we work
      • NBConsult Group
      • Partners
      • Lightbox Digital
    • Blog
    • Join us
    • Contact

    • Home
    • Services
      • Application & software development
      • Outsourced software development
      • Project based resourcing
      • Digital marketing & consulting
      • Graphic design & consulting
      • UI / UX design & consulting
      • Recruitment services
      • Lease an expert
    • About
      • How we work
      • NBConsult Group
      • Partners
      • Lightbox Digital
    • Blog
    • Join us
    • Contact

    • Home
    • Services
      • Application & software development
      • Outsourced software development
      • Project based resourcing
      • Digital marketing & consulting
      • Graphic design & consulting
      • UI / UX design & consulting
      • Recruitment services
      • Lease an expert
    • About
      • How we work
      • NBConsult Group
      • Partners
      • Lightbox Digital
    • Blog
    • Join us
    • Contact

    • Home
    • Services
      • Application & software development
      • Outsourced software development
      • Project based resourcing
      • Digital marketing & consulting
      • Graphic design & consulting
      • UI / UX design & consulting
      • Recruitment services
      • Lease an expert
    • About
      • How we work
      • NBConsult Group
      • Partners
      • Lightbox Digital
    • Blog
    • Join us
    • Contact
    my java exceptionutil class
    My Java ExceptionUtil Class
    Sep 16, 2019
    how to use ckeditor 5 in angular with server side rendering support
    How To Use CKEditor 5 In Angular With Server Side Rendering Support
    Sep 28, 2019

    System Environment Variables On Windows

    Categories
    • Software Development
    Tags
    • code snippet
    • environment variables
    • file location
    • java
    • windows
    system environment variables on windows
    system environment variables on windows

    This week I did research on environment variables in Java on a Windows system. Let me create a scenario for you: we are creating a Java program where a file is uploaded and then is saved some where on your personal computers directory (somewhere being a specific place you would like to save it to).

    In order to do this you need to use environment variables so that users can change where they would like the file to be saved.

    In your java program you will use the line of code:

    System.getenv("DIRECTORY");

    • Where DIRECTORY is the name of your system variable.
    • This will give you the file location for the file to be saved to.

    Now you need to create an environment variable with the same variable name you used in the previous code snippet.

    In order to create a new system variable follow these steps:

    1. Run your command prompt as Administrator
    2. Create a env.bat file
    3. In the file type: set Variable "C:\%USER%\Value" -m
      • Where:
        • Variable is the name of your new environment variable,
        • %USER% gets the user environment variable.
      • Value is the rest of the file directory that you would like this new environment to save to.
    4. Save the env.bat file
    5. In your command prompt run the env.batch file by typing env
    6. Your environment variable is now created.

    Contact us


      Related posts:

      angularUpdating A Primitive Type Variable From A Service In Angular laravel livewireLaravel Livewire how to setup git-ftp for windowsHow To Setup Git-ftp For Windows how to deploy your app/website on herokuHow To Deploy Your App/Website On Heroku
      Share
      15
      Rayne Logan
      Rayne Logan
      Rayne is a web developer with experience in PHP web apps and has an interest in project management and mobile development.

      Leave a Reply Cancel reply

      Your email address will not be published. Required fields are marked *

      Lava Lamp Lab


      Like technology, a lava lamp constantly changes form, producing new conditions with every passing moment



      lava lamp lab facebook   lava lamp lab twitter   lava lamp lab linkedin   lava lamp lab instgram

      Services


      Application & software development

      Outsourced software development

      Project based resourcing

      Digital marketing & consulting

      Graphic design & consulting

      UI / UX design & consulting

      Contact Us


      +27(0) 83 419 4851

      +27(0) 21 036 1165


      switchon@lavalamp.biz


      Unit 4 Monaco Square,
      14 Church Street,
      Durbanville,
      Cape Town, 7550

      NBConsult Group


      nbconsult
      nbconnect msp
      nbclearning
      river broadband
      designer needed
      © 2023 Lava Lamp Lab (Pty) Ltd | All Rights Reserved | Privacy Policy
      Contact us now

        Application & software development

          Outsourced software development

            Project based resourcing

              Digital marketing & consulting

                Graphic design & consulting

                  UI/UX design & consulting

                    Lease an expert

                      Recruitment services

                        We are using cookies to give you the best experience on our website.

                        You can find out more about which cookies we are using or switch them off in settings.

                        Lava Lamp Lab
                        Powered by  GDPR Cookie Compliance
                        Privacy Overview

                        This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

                        Strictly Necessary Cookies

                        Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.

                        If you disable this cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.

                        3rd Party Cookies

                        This website uses Google Analytics to collect anonymous information such as the number of visitors to the site, and the most popular pages.

                        Keeping this cookie enabled helps us to improve our website.

                        Please enable Strictly Necessary Cookies first so that we can save your preferences!

                        Cookie Policy

                        More information about our Cookie Policy