aspose file tools*
The moose likes Java in General and the fly likes Problem running on another PC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Problem running on another PC" Watch "Problem running on another PC" New topic
Author

Problem running on another PC

Paras Ahuja
Ranch Hand

Joined: May 22, 2012
Posts: 62
Hi everyone,
I have made a Java project using JDBC and Swing and used MS Access as database. I have used JDBC-ODBC Bridge Driver to connect with database. Now when i run on another PC,
1) i make the required DSNs to make the project run.
2) i also have some files that store comboboxes and some store vector arrays. I copy those files on the PC.
3) Also i read some excel files using FileInputStream(using ApachePOI). I also copy these excel files on the PC.

The actual problem is with the last two. When i run the program, the part that only uses the DSNs runs perfectly but the part of the program that also tries to read the files does not run.
I have made a JAR file of the program whose main class is my program's first page.

Any idea what i can do to make the whole project run on another PC.

Thanks in advance

Ralph Cook
Ranch Hand

Joined: May 29, 2005
Posts: 479
We need more information - what is a DSN? What errors do you get? etc.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
How does the part that reads the files address them?

Have you made assumptions about the "current" directory? That is a common error.

Bill
Paras Ahuja
Ranch Hand

Joined: May 22, 2012
Posts: 62
Hi William,
You got my error. But how am i supposed to rectify it?
Should i keep all the files in a common place(like C:/) and access them from there?
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 8010
    
  22

Paras Ahuja wrote:Should i keep all the files in a common place(like C:/) and access them from there?

No, because not all machines will have a C: drive. Normal practise for stuff that is 'tied to' an app is to include them in the jar.

Winston


Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
 
Consider Paul's rocket mass heater.
 
subject: Problem running on another PC