0

I am loockig for a way to copy paste a .exe file to a outside place of the jar, so it can run. It should work so that you only have to start the .jar file once on a pc and it set ups all the .exe files needed.

enter image description here

InputStream in = Class.class.getResourceAsStream("Driver/chromedriver.exe");

Files.copy(in,new File(path + "/revTranslator/Driver/chromedriver.exe").toPath());

thats how I tried to copy and paste it

carlos.gmz
  • 100
  • 8
  • Possibly a duplicate of: https://stackoverflow.com/questions/4330936/how-can-i-convert-a-jar-to-an-exe/20565393 ? – jmm Sep 30 '20 at 20:54
  • no, I want to paste a chromedriver into the appdata, so the user dont has to download it – carlos.gmz Sep 30 '20 at 20:56
  • So what's your question/problem? What happens when you run the code you are showing us? What does the screenshot you provide have to do with this? – CryptoFool Sep 30 '20 at 21:15
  • null pointer exception in line 198. maby the cgromedriver is saved in the wrong place. where does the path of the getRecource as stream inputwriter starts? – carlos.gmz Sep 30 '20 at 21:21

1 Answers1

0

the mistake was the inputstream. I had to change the code to: "Frame.class.getResourceAsStream("Driver/chromedriver.exe");"

carlos.gmz
  • 100
  • 8