I am trying to excute java from solaris, getting invalid argument error

穿精又带淫゛_ 提交于 2019-12-11 04:01:08

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!