How to call a .jar file

edited January 2016 in Library Questions

Hello i would like know how can i load a .jar in .pde

I know laod(mouse.png) work bur i don't if i can write load(java_t.jar)

.jar is runtime version of my programe

ps : sorry if i did some spelling mistake. I am french

Answers

  • What do you mean by load jar into pde? Do you want to execute jar file from processing program or do something else?

    BTW, there's no method load(mouse.png), instead you use loadImage("mouse.png"); :-B

  • I want to launch my .jar in my processing program

  • edited January 2016

    You need some Java code. Here it is advised to use ProcessBuilder. In terms of processing, I think it should be like: import java.lang.ProcessBuilder; on top

    // in setup
    ProcessBuilder pb = new ProcessBuilder("/path/to/java", "-jar", "your.jar");
    pb.directory(new File("preferred/working/directory")); 
    
    //in for example, mousePressed(), but not in draw()!!
    Process p = pb.start(); 
    

    You can search for other options on executing jar from java program on internet.

Sign In or Register to comment.