简体   繁体   中英

executing java command from VBA on MAC

I would simply like to execute a java class from within VBA on MAC.

In the MAC terminal one just types "java" and it executes the java command.

I tried:

t = "Macintosh HD:System:Library:Java:JavaVirtualMachines:1.6.0.jdk:Contents:Home:bin:java"
MacScript (t)

or

   t = "Macintosh HD:System:Library:Java:JavaVirtualMachines:1.6.0.jdk:Contents:Home:bin:java"
   shell (t)

but get runtime error 5 Invalid procedure call or argument.

I guess this is because 1.6.0.jdk is not simply a folder which I can include in the path - but I am not sure.

How would I have to call java from within VBA?

once this works I need to actually call: java myFile

How do I include the complete path for the java command and then the complete path for myFile?

Many thanks

除非您使用像JavaBridge这样的运行时桥,否则您不能从VBA调用Java函数,也可以使用Web服务包装VBA。

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM