1

My user.home system property is ?, instead of the home directory ($HOME has good value). I've discovered this because Maven tries to put its local repo inside ./?/.m2.

The problem is demonstrated by this small test case (taken from Change user.home system property)

public class Test {
  public static void main(String[] args) {
    System.out.println(System.getProperty("user.home"));
  }
}

and

javac Test.java
$ javac Test.java 
$ java Test
?

My only environment variable starting with JAVA is $JAVA_HOME (pointing to a openjdk-15.0.1-ga), and there is no environment variable starting with _JAVA

If it matters, the system is CentOS 7.8.

Zvika
  • 1,542
  • 2
  • 17
  • 21
  • check variable $HOME, and if it's empty try to see `HOME=/myhome java Test` – Jack May 20 '21 at 07:11
  • `echo $HOME` returns `/home/zvikah` – Zvika May 20 '21 at 07:15
  • 1. As you said, this question is duplicate. Should I delete it? 2. I actually found a similar, but different answer. Added it to the other question: https://stackoverflow.com/a/67615939/1543290 – Zvika May 20 '21 at 07:37

0 Answers0