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.

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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.