I want to launch a file(a document) from a Java program and phase the following requirements:
The file is created runtime, a result from a report being created. Any good practices?
Java FileInputStream class is used to open and read a file. We can open and read a file by using the constructor of the FileInputStream class. The signature of the constructor is: public FileInputStream(File file) throws FileNotFoundException.
roslaunch is used to open launch files. This can be done by either specifying the package the launch files are contained in followed by the name of the launch file, or by specifying the file path to the launch file. Note: roslaunch will also start roscore if no master has been set.
C++ Programming Type 'javac MyFirstJavaProgram. java' and press enter to compile your code. If there are no errors in your code, the command prompt will take you to the next line (Assumption: The path variable is set). Now, type ' java MyFirstJavaProgram ' to run your program.
Use Java Desktop API.
Desktop.getDesktop().open(new File(yourfilename));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With