【问题标题】:Java is not recognized on my macs terminal在我的 Mac 终端上无法识别 Java
【发布时间】:2015-10-01 03:23:59
【问题描述】:

我正在尝试为 1.8 及更高版本制作 Minecraft Bukkit 服务器,但 java 在我的 mac 终端中不能作为命令工作。我确实拥有最新的 Java JDK,但它在我的终端中无法运行命令...请帮助

【问题讨论】:

  • 在您的 .Bash 文件中创建 Java_home。谷歌它!
  • 设置“JAVA_home”系统环境变量并将其添加到“PATH”变量中。谷歌会告诉你怎么做。
  • 我该怎么做这些事情对不起我是一个完整的计算机菜鸟(谷歌没有帮助”

标签: java macos


【解决方案1】:

在终端中单独输入java,并注释输出。如果你得到这个输出:

    Usage: java [-options] class [args...]
           (to execute a class)
   or  java [-options] -jar jarfile [args...]
           (to execute a jar file)
where options include:
    -d32      use a 32-bit data model if available
    -d64      use a 64-bit data model if available
    -server   to select the "server" VM
                  The default VM is server,
                  because you are running on a server-class machine.


    -cp <class search path of directories and zip/jar files>
    -classpath <class search path of directories and zip/jar files>
                  A : separated list of directories, JAR archives,
                  and ZIP archives to search for class files.
    -D<name>=<value>
                  set a system property
    -verbose:[class|gc|jni]
                  enable verbose output
    -version      print product version and exit
    -version:<value>
                  require the specified version to run
    -showversion  print product version and continue
blah blah blah....

然后安装了java,但是你的JAVA_home 变量没有设置。 此链接将帮助您进行设置:Oracle JDK

【讨论】:

  • (-bash: java: command not found) ... 是我收到的不带括号的输出
  • 你为什么要我做某事却没有回应?
  • 你好。去oracle重新安装java。
  • 我做了,它告诉我同样的事情
  • 这个问题在我输入这个命令后开始发生:#!/bin/bash cd "$(dirname "$0")" exec java -Xmx2G -Xms2G -jar spigot.jar nogui
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-06-10
  • 1970-01-01
  • 1970-01-01
  • 2015-03-20
  • 2021-04-20
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多