Results 1 to 12 of 12
- 09-10-2009, 10:47 AM #1
Member
- Join Date
- Sep 2009
- Posts
- 13
- Rep Power
- 0
Need help with eclipse 3.4 and external jar file
Hi all,,
i'm trying to develop billing application for my assignment,, when trying to develop this app,, i'm stuck on this problem..
i want to run external jar file on eclipse,, here me source code.. ( i've modify a little,, just to save space)
public static void main(String args[]) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Desktop.getDesktop().open( new File(this.getClass().getResource("jrdesktop-0.3b.jar").getFile()));
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
and receive error :
The file: C:\Documents%20and%20Settings\Om%20Dino\workspace\ BillingServer-Eclipse\bin\jrdesktop-0.3b.jar doesn't exist
any help would be vary appreciate..
thx..
- 09-10-2009, 10:49 AM #2
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
Does the file exist on the reported path then?
- 09-10-2009, 11:12 AM #3
Member
- Join Date
- Sep 2009
- Posts
- 13
- Rep Power
- 0
thx for quick reply..
i put that file on bin directory of my project..
any suggestion for me ?
thx b4..
- 09-10-2009, 11:17 AM #4
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
- 09-10-2009, 11:32 AM #5
Member
- Join Date
- Sep 2009
- Posts
- 13
- Rep Power
- 0
yup..
same folder..
- 09-10-2009, 11:33 AM #6
Member
- Join Date
- Sep 2009
- Posts
- 13
- Rep Power
- 0
yup..
same folder..
- 09-10-2009, 11:37 AM #7
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
As you can see from your code Netbeans can't find it from that path. Perhaps you need to refresh your project after the jar there.
So why are you trying to run the jar file from your code any way? Why can't people just double click that jar file if they want to run it?
- 09-10-2009, 02:36 PM #8
Member
- Join Date
- Sep 2009
- Posts
- 13
- Rep Power
- 0
sory for taking so Long..
i'm using eclipse IDE,,
As you can see,, those jar (jrdesktop-0.3b.jar) was intended to be run inside my java app..
in future development i want handle an event click to run those jar from my app..
id don not want user to run those jar without my application.
(i assume in billing application,, only my application permitted to be run)
any suggestion for me ?
thx..
- 09-10-2009, 02:41 PM #9
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
Instead of running the jar file, why not just do what it's main class' main method does on the event handler?
- 09-10-2009, 03:35 PM #10
Member
- Join Date
- Sep 2009
- Posts
- 13
- Rep Power
- 0
i'm sory, but i dont know what you meant..
sorry..
would you explain to me..
- 09-10-2009, 09:38 PM #11
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
The jar file is runnable so it has a main class specified in it's manifest. The main method of that main class is going to be run when that jar file is clicked. So in your handler you can just do
Java Code:MainClass.main(null);
- 09-11-2009, 01:48 PM #12
Member
- Join Date
- Sep 2009
- Posts
- 13
- Rep Power
- 0
Similar Threads
-
'Javac' is not recognized as an internal or external command or batch file
By FinalFatexX in forum New To JavaReplies: 19Last Post: 11-27-2010, 12:31 AM -
Execute external file/program
By sirwiggles in forum New To JavaReplies: 3Last Post: 04-21-2009, 11:35 PM -
External runtime resources access in Eclipse
By batkins61 in forum EclipseReplies: 0Last Post: 01-07-2009, 05:42 PM -
Link an external compiler to the eclipse environment throw the console in eclispe
By adolf111 in forum EclipseReplies: 1Last Post: 12-13-2008, 01:24 AM -
Use a external file in my program
By romina in forum New To JavaReplies: 1Last Post: 08-07-2007, 05:28 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks