Example Code

LabVIEW Java Compiler

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

 

Overview
Attached is a VI that will allow you to compile Java code straight from LabVIEW 2012.

 
Description
The VI works by creating a batch file which is used to run command prompts which call the relevant commands to compile the Java code using the JAVA JDK compiler.

I have attached a simple Hello World Java code which you can use to test this VI.

Please note that it is possible to download my other example which shows the creation of Palettes. This will include the software required and all the VIs and the only thing you need to do is run an install.bat file.

Also, note that I will be further developing this to add the java text editing into LabVIEW as well.

 
Requirements

  • LabVIEW 2012 (or compatible)
  • JAVA JDK compile

Steps to Implement or Execute Code

  1. Unzip the attached folder to your computer
  2. Create your Java code using notepad or any other text editor.
  3. Open the VI "Compiler.vi"
  4. Set the Java file path to the location of your Java file.
  5. Run the program and it should compile your Java code and create the necessary class file.
  6. The compiler will finish by running the Java application.

 

Additional Information or References
VI Block Diagram
5-9.png

 **This document has been updated to meet the current required format for the NI Code Exchange.**


Larry Colvin
Associate Principal Engineer
Dyson Technology Ltd.

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
meddeb.safouene@gmail.com
Member
Member
on

Hi,

I am using the block Open URL in Default Browser.vi (Labview 2013). i want after the browser open my URL close it automatically after few seconds . can any one help me please

Best Regards