0

hello!.
i need help with import in java.
i want for example when i click a button in java to open a exe file,so i imported the exe into java,and i make the program everything is okay.
so i export my classes into a jar file,so when i click the button nothing will happened because "the path" of the exe file ,so in VB for example we can embed this exe file so it worked,so can i do this in java?so this exe file or any other file like pictures or others can i embed them?so when i create the jar file i can move him for example to another directory and when i cliked the button i open this exe file?.
thank you very much.

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by cocoll
0

don't really see how you can import a .exe in Java
will love to see the actual syntax of your import statement.
Anyhow, if you managed to realize that exploit, for it to work in a .jar you will have to jar the .exe and use methods like getCodeBase() to locate this file in your .jar

0

i don't mean import like import java.util.*; ,no i mean import and export when we click a right click in the project,that's why i write import pictures and others,so this is the code:

try {
		Process p = Runtime.getRuntime().exec("WindowsApplication1.exe");
		} catch (IOException e) {
			
			e.printStackTrace();
		}

so when i create the jar file,i want that "WindowsApplication1.exe" opened where i want to opened it.
thank you.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.