Skip to content
This repository was archived by the owner on Sep 19, 2025. It is now read-only.
This repository was archived by the owner on Sep 19, 2025. It is now read-only.

Java doesn't seem be looked for in the path #160

@sbc100

Description

@sbc100

The docs say "Requires java to be installed and in the path" but this doesn't seem to be true.

The code in getFirstSupportedPlatform seems to return true for java if its the last option or if one sets "JAVA_HOME".

function getFirstSupportedPlatform(platforms) {                                     
  const platform = platforms.find((platform, index) => {                            
    switch (platform.toLowerCase()) {                                               
      case "java":                                                                  
        if (index === platforms.length - 1) {                                       
          return true;                                                              
        }                                                                           
        return process.env.JAVA_HOME;                                               
                                                                                    
      case "javascript":                                                            
        return true;                                                                
                                                                                    
      case "native":                                                                
        if (getNativeImagePath()) {                                                                                           
          return true;                                                              
        }                                                                           
    }                                                                               
  });       

We noticed this because the we are having trouble the JS version on windows and the javascript version was being chosen despite java being the PATH and the code looks like it prefers that version:

platform = getFirstSupportedPlatform(['native', 'java', 'javascript'])

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions