Skip to content

error JAVA_HOME For nushell #248

@xOnlinEx

Description

@xOnlinEx

I'm trying to set up JAVA_HOME in Nushell

source ~/.asdf/plugins/java/set-java-home.nu

but I'm getting this error

Error: nu::parser::assignment_requires_variable

  × Assignment operations require a variable.
   ╭─[/home/xonlinex/.asdf/plugins/java/set-java-home.nu:8:9]
 7 │         let $java_home = ($full_path | path dirname | path dirname)
 8 │         let-env JAVA_HOME = $java_home
   ·         ────────┬────────
   ·                 ╰── needs to be a variable
 9 │         let-env JDK_HOME = $java_home
   ╰────
  help: try assigning to a variable or a cell path of a variable

my config the nushell config.nu:

> cat .config/nushell/config.nu
# ASDF-VM
let shims_dir = (
  if ( $env | get --ignore-errors ASDF_DATA_DIR | is-empty ) {
    $env.HOME | path join '.asdf'
  } else {
    $env.ASDF_DATA_DIR
  } | path join 'shims'
)
$env.PATH = ( $env.PATH | split row (char esep) | where { |p| $p != $shims_dir } | prepend $shims_dir )

# JAVA_HOME
source ~/.asdf/plugins/java/set-java-home.nu

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions