简体   繁体   中英

Can I include Java code with VB.NET code?

如何在VB.NET代码中包含Java代码?

I'm not sure what you mean, but if you want to run java code inside vb.net or vice versa, the way I would do it is by launching a new java process from VB.net or launching the vb.net app executable from Java (both would require your apps being compiled before launching them, however).

To launch a new process from Java, consider:

  • Runtime.exec

    Example: Runtime.getRuntime().exec("myVBApp.exe");

  • ProcessBuilder

    Example: ProcessBuilder process = new ProcessBulder("myVBApp.exe");

To launch a new process from VB.Net, consider:

  • Shell

    Example: Shell("java myJavaApp")

  • Process

    Example: Process.Start("java","myJavaApp")

All examples would require some more code if you want to do anything more meaningful than just launch the process, but the links ought to point you in the right direction.

As for your real player plugin question, that probably warrants a separate question. Best to keep each question on one topic.

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