1

Used eclipse in the past fro java coding and didn't have many issues but decided to give netbeans a blast

I'm trying to create a jar file with all dependencies as one jar and yes am familiar with the java-web-start-option and also the jar actually exists in my dist folder once built.

Problem 1

All's good and well, I can launch the jar but seems not without its lib folder which contains: AbsoluteLayout.jar + beanbindings.jars. Something I will need to figure out as I go along.

I call a few batch scripts to complete differenet jobs for me in the java program e.g. one finds memory amounts and displays in a JTextArea. When I use the program within the netbeans ide all works fine.

Problem 2

When I launch the jar file thats in the dist folder it launches just fine but cannot find the batch/bash scripts at all. Below is the path I use within the program which as I mentioned works fine in the IDE and just wondering why it cant find the same path in the jar.

I assumed when I created and built like in eclipe it would make all these commands work in the existing jar in my dist folder (bin in eclipse ofc)?

    String[] filepath = {"cmd.exe", "/C", "..\\Enterprise\\src\\enterprise\\batch\\memory.bat"}

Any suggestions, thanks in advance!

Jim Clyne
  • 39
  • 5
  • 1
    `AbsoluteLayout.jar` That is bound to cause problems down the track. Use standard J2SE (or other 3rd party non-null) layouts for more robust GUIs. *"decided to give netbeans a blast and sorry I did."* If I wanted to encourage the Netbeans gurus to contribute, that is definitely not something I would mention. It is not relevant to the problem, and could be quite irritating. – Andrew Thompson Jan 29 '13 at 01:19

1 Answers1

0

Just try to change your path. Just make a flag if it's in your ide then select this path, if not then use another path. Try this link to get the application path in java.

Get the application's path

Community
  • 1
  • 1
nsutgio
  • 240
  • 2
  • 6
  • 15
  • Thanks for both your comments, your link helped me sort the issue nsutgio. Went with a basic path [code]String[] filepath = {"C:\\batch\\memory.bat"};[/code] and found netbeans suggested I create the batch folder in question when I closed and re-entered the IDE. – Jim Clyne Jan 29 '13 at 12:25