aspose file tools*
The moose likes Linux / UNIX and the fly likes Working with Java in UNIX Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Working with Java in UNIX" Watch "Working with Java in UNIX" New topic
Author

Working with Java in UNIX

Anita Hari
Greenhorn

Joined: Dec 05, 2008
Posts: 4
Hi All,

I am working on a Java based application which runs in a UNIX environment in an AIX machine. The procedure how I work is,

1. Create all java files, compile to class files, package them into jar files using RAD IDE in my Windows XP machine.
2. Copy the jar file from my local system to the UNIX machine using a FTP tool like WINScp.
3. Use shell script to run the java program in the UNIX machine.


So, whenever my code encounters issues, I have to repeat the same above said 3 procedures each and every time while doing unit testing. This delays the testing and rework phase.

Is there any better way to work with Java in UNIX? Please let me know.

Thanks,
Anita
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11460
    
  94

First up, you probably should look at the document that was auto-linked when you typed unit - it describes unit testing versus functional testing versus integration testing and more. You should be able to do all unit testing on your Microsoft Windows XP computer.

Some things to think about. They are not mutually exclusive, and any one of them might help -

Why are you using a Microsoft Windows XP computer if your deliverable requires a *nix operating system? Have you considered doing your development on a GNU/Linux system? Ubuntu is designed for people who are relatively new to setting up *nix systems - it is designed for ease of use. If you really need to be running Microsoft Windows applications, you might want to consider VirtualBox or VMWare or Parallels and have multiple operating systems running simultaneously.

As a much more lightweight option, (depending on what you are doing within your shell script), you might want to consider installing CygWin to add a lot of the GNU/*nix tools to the limited Microsoft Windows environment.

You might want to consider putting Jenkins on the server and have it run the tests automatically on the AIX system whenever you check code into source control.

You might ask the system administrators if they can export a drive as an NFS mount, which you could then mount as an NFS drive under Microsoft Windows. I would not recommend having your development environment on the exported drive, but it would make it easier to copy the binary files across. Technically speaking you could also ask them to install Samba so the AIX computer could appear as a Microsoft Windows server, or configure an Apache HTTP server to serve up WebDAV that you could then have Microsoft Windows connect to as a shared drive. Depending on your administrators the NFS mounts may be the easier option to ask for.

If you are using ant, then you can use the scp task as part of your build process to automatically copy the file across to the AIX system whenever the Jar file is created/updated. You could also use the sshexec task to run the shell script as part of the same process.


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4658
    
    5

Anita Hari wrote:Is there any better way to work with Java in UNIX? Please let me know.


I can't imagine developing anything without an IDE, which means running the development world on the same, or at least very similar OS. You can, if you want, install Eclipse or Netbeans on the AIX box, and use X-Windows to work on it from your evil Windows box. But I'd just put Ubuntu on my box, either a dual boot setup, or format C: and remove Windows completely. Real developers use the shell. :-)
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16068
    
  21

Pat Farrell wrote:
Anita Hari wrote:Is there any better way to work with Java in UNIX? Please let me know.


I can't imagine developing anything without an IDE, which means running the development world on the same, or at least very similar OS. You can, if you want, install Eclipse or Netbeans on the AIX box, and use X-Windows to work on it from your evil Windows box. But I'd just put Ubuntu on my box, either a dual boot setup, or format C: and remove Windows completely. Real developers use the shell. :-)


Java really is (mostly) "write once, run anywhere" and I've done development on Windows for deployment on Linux and Solaris (sometimes both at once!) for a number of years. So, unless there's something nasty like native-code classes in the app, testing the app on Windows can really cut down on the copy-to-AIX work.

Until fairly recently, my data uplink was so slow that deploying a new release took over half an hour. Local testing was essential.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Working with Java in UNIX