Windows JAVA HOME问题 [英] Windows JAVA HOME problems

查看:122
本文介绍了Windows JAVA HOME问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Windows Vista服务器上使用Java的OracleHelp.我下载了Oracle帮助,并且正在遵循其安装说明,其中指出:

I'm trying to experiment with OracleHelp for Java on my Windows Vista server. I downloaded Oracle help, and I'm following their installation instructions which states:

  • 将OHJ安装.zip文件解压缩到您选择的目录中
  • 确保已将JAVA_HOME环境变量设置为兼容Java SE安装的位置
  • 在OHJ安装目录中,有一个bin子目录,其中包含Windows .cmd文件和Unix/Linux Shell脚本.在Windows平台上,双击.cmd文件以启动它们(或在命令行上键入.cmd文件名).在Unix平台上,键入"sh scriptName.sh"以执行Shell脚本.

  • Unzip the OHJ installation .zip file into a directory of your choice
  • Ensure that you have the JAVA_HOME environment variable set to the location of your compatible Java SE installation
  • In the OHJ installation directory, there is a bin subdirectory containing Windows .cmd files and Unix/Linux shell scripts. On Windows platforms, double click on the .cmd files to launch them (or type the .cmd file name on the command line). On Unix platforms, type "sh scriptName.sh" to execute the shell scripts.

  • ohguide.cmd(ohguide.sh)-启动《 Oracle帮助指南》文档
  • choiceDemo.cmd(choiceDemo.sh)-启动Oracle帮助功能演示
  • cshDemo.cmd(cshDemo.sh)-启动上下文相关帮助的演示
  • helpsetDemo.cmd(helpsetDemo.sh)-启动帮助集预览器以测试您的帮助集
  • authoringWizard.cmd(authoringWizard.bat)-启动帮助集创作向导

当我在Windows上设置JAVA_HOME时,可以将其设置为带或不带引号.两种方法都失败:

When I set JAVA_HOME on windows I can set it with or without quotes. Either way fails :

C:\Users\Amir\Desktop\ohj-5_0_0_433\ohj-5_0_0_433\bin>set JAVA_HOME="C:\Program
Files (x86)\Java\jdk1.6.0_14"
C:\Users\Amir\Desktop\ohj-5_0_0_433\ohj-5_0_0_433\bin>ohguide.cmd
C:\Users\Amir\Desktop\ohj-5_0_0_433\ohj-5_0_0_433>""C:\Program Files (x86)\Java\
jdk1.6.0_14"\bin\java.exe" -classpath "ohj.jar;help-share.jar;oracle_ice.jar;jew
t.jar;share.jar;help-demo.jar" oracle.help.demo.ChoiceDemo "demodoc\ohguide\ohgu
ide.hs"
'""C:\Program' is not recognized as an internal or external command,
operable program or batch file.

不带引号:

C:\ Users \ Amir \ Desktop \ ohj-5_0_0_0_433 \ ohj-5_0_0_433 \ bin>设置JAVA_HOME = C:\ Prog iles(x86)\ Java \ jdk1.6.0_14

without quotes:

C:\Users\Amir\Desktop\ohj-5_0_0_433\ohj-5_0_0_433\bin>set JAVA_HOME=C:\Prog iles (x86)\Java\jdk1.6.0_14

C:\ Users \ Amir \ Desktop \ ohj-5_0_0_433 \ ohj-5_0_0_433 \ bin> ohguide.cmd 无法将文件"识别为内部或外部命令, 可操作的程序或批处理文件. 找不到Java虚拟机;请设置JAVA_HOME环境变量.

C:\Users\Amir\Desktop\ohj-5_0_0_433\ohj-5_0_0_433\bin>ohguide.cmd 'Files' is not recognized as an internal or external command, operable program or batch file. No Java Virtual Machine found; please set JAVA_HOME environment variable.

推荐答案

我在Windows系统属性中对其进行了设置,并且效果很好.

I set it in Windows System Properties and that works fine.

在Vista上:

  1. 点击开始"按钮(Windows徽标,左下角)
  2. 右键单击计算机
  3. 选择属性
  4. 选择高级系统设置(左侧选项)
  5. 选择环境变量(按钮)
  6. 添加(或编辑)系统变量JAVA_HOME
  7. 输入不带引号的JAVA_HOME
  8. 添加到PATH系统变量中以包含JDK的路径(因此您不必担心如何引用它.
  9. 您可能还想扩展CLASSPATH系统变量,使其包含您将在命令行上指定的变量(可选)

这篇关于Windows JAVA HOME问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆