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

Find javac and jar using the JAVA_HOME #1714

Open
bdbaddog opened this issue Jan 2, 2018 · 1 comment
Open

Find javac and jar using the JAVA_HOME #1714

bdbaddog opened this issue Jan 2, 2018 · 1 comment
Labels
enhancement Java Java tools and language support Version: 0.97

Comments

@bdbaddog
Copy link
Contributor

bdbaddog commented Jan 2, 2018

This issue was originally created at: 2007-08-22 19:36:24.
This issue was reported by: tpurl.
tpurl said at 2007-08-22 19:36:25

From my experience, the vast majority of Java developers set the JAVA_HOME environment variable. It points to the root of the JDK directory.

A lot of Java development tools (such as Ant) use the JAVA_HOME tool to infer the location of java, javac, and jar. It would be very useful if the scons tools inferred the location of the java development tools based on that
variable's value.

For more information, please see the following mailing list thread:

Thanks for considering this!

Tom Purl

gregnoel said at 2008-06-05 17:38:27

Bug party triage: A good idea for javac and javah (jar should eventually be based on the Python zipfile module, as it's faster and more flexible; see issue #1704. Could possibly be implemented as an optional argument to Detect() with the path to try after exhausting the standard path; it would return the full path if the command was found in the extended locations.

russel said at 2008-06-05 22:07:20

Whilst it is usual for JAVA_HOME to be set, it is not mandatory. It would therefore be a bad idea to assume it. A good algorithm is to search for the commands in JAVA_HOME/jre/bin and JAVA_HOME/bin if JAVA_HOME is set, otherwise do a search of PATH.

Also of course jar and javac only come with the JDK not in the JRE so the java command may be present but not the others.

gregnoel said at 2008-12-26 13:29:10

Adjust triage of issues.

russel said at 2009-08-28 00:37:36

Adding Russel to the CC list

managan said at 2009-08-28 12:48:32

add java to keywords

@bdbaddog bdbaddog added this to the 2.x milestone Jan 2, 2018
@bdbaddog bdbaddog added the Java Java tools and language support label May 14, 2019
@mwichmann mwichmann removed this from the 2.x milestone Mar 26, 2021
@mwichmann mwichmann removed the P2 label Mar 26, 2021
@mwichmann
Copy link
Collaborator

Looks to me like #2772 and #2776 are asking for the same thing (taking the more general "improve" rather than the specific solutions suggested). Maybe we could combine these into just one open issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Java Java tools and language support Version: 0.97
Projects
None yet
Development

No branches or pull requests

2 participants