so I have recently been using AutoHotkey and I am a fan as of now but I am running into a couple of issues. I usually compile and run my Java programs from the command terminal in Windows 7. The paths for the compiler ( javac
) and to run the program ( java
) are set properly and run when I open command prompt without using AutoHotkey. But, as soon as I run an AHK script that opens up the command terminal from the same location and try and use the java
command I get the following message
Error: could not open 'C:\\Program Files(x86)\\Java\\jre7\\lib\\i386\\jvm.config'
I understand that it would not be able to find this location considering I am running Java 1.8.5_05
but I do not know why the path is not working properly. The stranger part is that when I open a command prompt with AutoHotKey javac
IS still recognized and running the correct version.
My question is this. Why am I able to successfully compile and run java programs when opening up the terminal when I click the cmd.exe
icon but am UNABLE to run java programs when the terminal is opened via a simple AutoHotKey script?
Any suggestions would be greatly appreciated.
Note: My systems path variable and user path variable are correctly set to JAVA_HOME
which points to the 1.8.5_05
version
Perhaps you can try running cmd with the /c flag.
For example running this line of code...
run, cmd /c ping google.com
...will open a command prompt, ping google.com, then close the command prompt.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.