Sponsored Content
Top Forums Programming Is Java really platform-independant? Post 302606648 by radoulov on Monday 12th of March 2012 10:15:55 AM
Old 03-12-2012
I believe the error you're seeing is related to JDK version mismatch.
I suppose that the latest version on the SPARC machine is older than the one used for the compilation on Win 7.
So:

1. Check the version on the Solaris machine: java -version.
2. Use the same version to compile on Windows
(I have very limited experience with Java, but I believe you need to use at least the same major version:
if you compile the code with JDK 7, it won't work with 6,
if you use 6 for compilation, it will work with both 6 and 7).
3. Try to execute the .class file that you've compiled on Windows on the SPARC machine again.

The JVM will hide the specific platform dependencies.
This User Gave Thanks to radoulov For This Post:
 
ant(1)							      General Commands Manual							    ant(1)

NAME
ant - a Java based make tool. SYNOPSIS
ant [OPTION]... [TARGET [TARGET2] [TARGET3] ...]] DESCRIPTION
Like make, ant is a tool that can compile Java projects. But unlike it, ant is based on Java which means that it will run on every platform that has a Java Virtual Machine. This makes it a great tool for building Java software. By default it takes information from build.xml which describes the targets. -help, -h print help on the command line options -projecthelp, -p print project help information -version print the version information and exit -diagnostics print information that might be helpful to diagnose or report problems. -quiet, -q be extra quiet -verbose, -v be extra verbose -debug, -d print debugging information -emacs, -e produce logging information without adornments -logfile <file>, -l <file> use given file for log -logger <classname> the class which is to perform logging -listener <classname> add an instance of class as a project listener -noinput do not allow interactive input -buildfile <file>, -file <file>, -f <file> use given buildfile -D<property>=<value> use value for given property -keep-going, -k execute all targets that do not depend on failed target(s) -propertyfile <file> load all properties from file with -D properties taking precedence -inputhandler <class> the class which will handle input requests -find <file>, -s <file> (s)earch for buildfile towards the root of the filesystem and use it -nice number A niceness value for the main thread: 1 (lowest) to 10 (highest); 5 is the default -nouserlib Run ant without using the jar files from ${user.home}/.ant/lib -noclasspath Run ant without using CLASSPATH -autoproxy Java 1.5+: use the OS proxy settings -main <class> override ant's normal entry point SEE ALSO
make(1) java(1) build.xml(5) Mac OS X June 22, 2009 ant(1)
All times are GMT -4. The time now is 07:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy