aspose file tools*
The moose likes Linux / UNIX and the fly likes java program written in Solaris(.class file) to run in LINUX 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 » Engineering » Linux / UNIX
Bookmark "java program written in Solaris(.class file) to run in LINUX" Watch "java program written in Solaris(.class file) to run in LINUX" New topic
Author

java program written in Solaris(.class file) to run in LINUX

Amod Kumar Singh
Greenhorn

Joined: Dec 10, 2007
Posts: 1
If a java program written in Solaris i.e. the class file is to be transferred to Linux and required to run is there any changes that are required to be made
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Hi,

Welcome to JavaRanch!

In general, no. .class files are portable to any Java virtual machine, on any platform. It's certainly possible to write Java code that will only run on some machines -- for instance, by hard-coding paths or other system-dependent information -- but otherwise, you can just copy the files and run them.


[Jess in Action][AskingGoodQuestions]
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16145
    
  21

... Or, as the saying goes, "Write Once, Run Anywhere".

I believe that Sun has a set of specs that, if adhered to, are guaranteed to be portable. I don't remember the full set, but one obvious one is not to use external non-java libraries, and its converse: wherever possible, use the JVM-supplied standard classes (the "java.*" classes), as they were designed to implement functions without depending on a particular set of hardware or OS.

I have a project I'm trying to get rolling that specifically chose Java as its platform because I wanted to be not only OS and hardware-independent, but independent of the windowing system and window desktop software of the user's machine.


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: java program written in Solaris(.class file) to run in LINUX