• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
... 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.
reply
    Bookmark Topic Watch Topic
  • New Topic