Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JAVA_HOME is null when running test via UI #9105

Closed
dipak-pawar opened this issue Mar 15, 2018 · 11 comments
Closed

JAVA_HOME is null when running test via UI #9105

dipak-pawar opened this issue Mar 15, 2018 · 11 comments
Assignees
Labels
kind/bug Outline of a bug - must adhere to the bug report template. severity/P2 Has a minor but important impact to the usage or development of the system.

Comments

@dipak-pawar
Copy link

Description

Env variable JAVA_HOME is null when running tests from UI. Whereas it's working as per expectation when running maven build from terminal.

Reproduction Steps:

screenshot from 2018-03-14 18-45-27

@ghost
Copy link

ghost commented Mar 15, 2018

@dipak-pawar what stack do you use?

@ghost ghost added the kind/question Questions that haven't been identified as being feature requests or bugs. label Mar 15, 2018
@dipak-pawar
Copy link
Author

@eivantsov I have used vert.x, java-centos. Getting same issue for both the stack.

@ghost
Copy link

ghost commented Mar 15, 2018

Is JAVA_HOME set as env there? Does java.home work?

@dipak-pawar
Copy link
Author

I can echo $JAVA_HOME on che terminal. But couldn't get it in java program.

whereas I can get System.getProperty("java.home") to respective jre directory.

@ghost
Copy link

ghost commented Mar 15, 2018

Worked for me:

image
image

@ibuziuk
Copy link
Member

ibuziuk commented Mar 15, 2018

@eivantsov does it work in junit test ?

@ghost
Copy link

ghost commented Mar 15, 2018

@ibuziuk I'll check

@ibuziuk
Copy link
Member

ibuziuk commented Mar 15, 2018

@eivantsov thanks, because it fails for me ;-)

@dipak-pawar
Copy link
Author

same case for me. It fails for Junit test.

@ghost ghost added kind/bug Outline of a bug - must adhere to the bug report template. team/ide severity/P2 Has a minor but important impact to the usage or development of the system. and removed kind/question Questions that haven't been identified as being feature requests or bugs. labels Mar 15, 2018
@garagatyi
Copy link

Same for me - not available in unit tests

@vparfonov
Copy link
Contributor

I think you can use System.getProperty("java.home"); instead.
We will close this issue as normal behavior because in you case tests run in separate jvm which doesn't have JAVA_HOME properties

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Outline of a bug - must adhere to the bug report template. severity/P2 Has a minor but important impact to the usage or development of the system.
Projects
None yet
Development

No branches or pull requests

4 participants