Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6040115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:28:03+00:00 2026-05-23T06:28:03+00:00

Hi as the subject reads System.getenv(HOME) in my action class (struts2) and deploy that

  • 0

Hi as the subject reads

System.getenv("HOME")

in my action class (struts2) and deploy that as a war in

/var/lib/tomcat6/webapps/

When i run my class, getenv HOME returns

/var/lib/tomcat6

Can anyone tell me whats going on? I even tested it out on a standalone java class.Returns the proper value of home. Tried it on shell also echo $HOME and it gives a proper output.

Running on Ubuntu 10.04.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T06:28:03+00:00Added an answer on May 23, 2026 at 6:28 am

    i THINK ive got what the problem is.. My project got deployed with permissions for “tomcat6 tomcat6” so when i getenv HOME, it gives me tomcat home. Am I right?

    No.

    The problem is that your tomcat6 service is configured to run as the “tomcat” user. (There is typically a variable in the init.d/tomcatd script that does this …) THIS IS DONE FOR SECURITY REASONS. Don’t change it unless you’ve done a proper risk assessment.

    What you really need to do is change your web application so that it doesn’t expect $HOME to be >>your<< home directory. Instead, create a webapp specific properties file that gives the location of this external (to tomcat) directory. Or better still (and best practice!) change your application so that it doesn’t need to refer to an external directory at all.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've just read some related questions that came up when I typed the subject,
I'd like to create a dynamic Multidimensional ArrayList that reads from a text file
Okay excuse the cryptic subject. I have a system which dynamically fetches image data
I've come across a system that is in use by a company that we
I have a navigation system that I wanted to make compatible with both javascript
Got a project that collects data as XML files from a particular system (these
This is the code that fetches up the sender and the subject of email.With
I am creating an addon for Outlook 2007 that reads a mail item when
I have a perl script that reads our firewall access logs to see who
I am working in Python with an Email() class that I would like to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.