File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Linux / UNIX and the fly likes Running a java file in Linux Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Running a java file in Linux " Watch "Running a java file in Linux " New topic
Author

Running a java file in Linux

Manzoor Elahi
Greenhorn

Joined: May 11, 2010
Posts: 11
Hi All

I have the following code running fine in WIndows. But in need to run the same in Linux. What changes do i need to make to access the folders to read and write the files.


Also , I will have to create a jar out of this and run the same every 5 minutes in the linux environment. Any Suggestions as to how can i set up a cron job will also be very helpful.

Third Help Any suggestions how i can improve the above code will also be very helpful. This is a Stand alone program and will run as an executable jar.

Thanks in Advance,
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5827
    
    7

What changes do i need to make to access the folders to read and write the files.

I assume you changed the lines that hard-code Windows paths to valid Linux paths. I also assume that you either installed the MySQL database. So what problems did you run into?


JBoss In Action
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

a) define your Paths in a shell-script, and you don't need to recompile your program when moving beteween Windows and linux.
b) Use much shorter methods.
c) Declare and initialize your variables as late as possible. The bigger the scope of your variables is, the harder it is to analyze, and the harder it is to refactor.


http://home.arcor.de/hirnstrom/bewerbung
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Running a java file in Linux