问题
I am giving command like this bash-3.00$/app/jdk1.6.0_11/bin/java -version , it is giving error like bash-3.00: /app/jdk1.6.0_11/bin/java: invalid argument
回答1:
"Invalid argument" is the error you get on Solaris when you try running a SPARC binary on an x86 platform. Make sure the java runtime you have installed in /app is the right version for your hardware - you can use the file
command to check, for example:
% file /net/pkg/export/pkg.sparc.sunos5/gnu/bin/ls
/net/pkg/export/pkg.sparc.sunos5/gnu/bin/ls: ELF 32-bit MSB executable SPARC Version 1, dynamically linked, not stripped
% file /net/pkg/export/pkg.i386.sunos5/gnu/bin/tar
/net/pkg/export/pkg.i386.sunos5/gnu/bin/tar: ELF 32-bit LSB executable 80386 Version 1, dynamically linked, not stripped
回答2:
Try
bash-3.00$ source /app/jdk1.6.0_11/bin/java -version
or
bash-3.00$ . /app/jdk1.6.0_11/bin/java -version
(Bash manual)
I suggest you adding Java JDK path to your Bash PATH environment variable, so you don't have to write the whole path.
来源:https://stackoverflow.com/questions/9428280/i-am-trying-to-excute-java-from-solaris-getting-invalid-argument-error