Call Java (.JAR) class using C ++ (.EXE)?

1

I have a Java application (SYSTEM.JAR) with the system input class ... Ok?

To make it more transparent to the end user, I'd like to create a compiled C ++ .EXE that just called the Java class.

Is it possible?

Which C ++ compiler is suggested? (the least possible, given the complexity)

Thank you.

Lucio

    
asked by anonymous 04.03.2015 / 12:24

1 answer

2

As said in the comments, this is not practical and does not make as much sense even for the end user. What I can recommend is to create an installer that extracts the files of your program into a folder and create a shortcut to the ".jar" on the Desktop. Or if you are integrating the system into every machine it uses, simply create the shortcut on the Desktop.

But in response to the original questions ...

"Is it possible?" Yes.

"Which compiler is suggested?" MinGW.

Example:

#include <cstdlib>
int main(){
    std::system("java -jar 'caminho-do-programa/Sistema.jar'");
    return 0;
}

This will start the .jar application and will close your mini-program in C ++.

    
04.03.2015 / 14:22