Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Running a java file in Linux

 
Manzoor Elahi
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic