VB code at "Shell (javaCommand)" returns 'file not found'

0 votes
asked Nov 9, 2012 in Closed question / help by anonymous
retagged Nov 26, 2012 by plantuml
Using Word 2010 & Windows 7. in VB code at "Shell (javaCommand)" I get error 'file not found'. its seeing the JAR files and I have installed JAVA.  I can run the command in a cmd window. What am I missing?

1 Answer

0 votes
answered Nov 9, 2012 by plantuml (265,060 points)

It seems like a path issue, or maybe some permission issue.

You can try to put the pull path to java.exe in the line:

    javaCommand = "c:\mydir\java -classpath """...

You could also add a line :

    MsgBox ("shell end")

Just after the line Shell (javaCommand) to double check that "file not found" is caused by Shell (javaCommand)

commented Nov 9, 2012 by anonymous
>> May want to add this to FAQ till Java 7 fixes their install <<
I just figured out how to fix it without having to modify VB code.  I installed JRE 7 and it did not properly set Environment Variables.  
To fix gointo Environment Variables
      Find these two variables
Variable Name: “PATH”, Add to Value: “;C:\Program Files\Java\jre7\bin”
Variable Name: “CLASSPATH”, Add to Value: “;C:\Program Files\Java\jre7\lib”
      If they do not exist Create new User Variables
Variable Name: “PATH”, Add to Value: “.;C:\Program Files\Java\jre7\bin.;”
Variable Name: “CLASSPATH”, Add to Value: “.;C:\Program Files\Java\jre7\lib.;”
...