简体   繁体   English

在终端 Linux 中执行 java 文件

[英]Executing java file in terminal Linux

i wrote one simple socket program and executing in linux Terminal, while compiling I am not facing any errors , but while running its giving following error..我写了一个简单的套接字程序并在 linux 终端中执行,在编译时我没有遇到任何错误,但是在运行它时会出现以下错误..

/root/Desktop/httpcore.jar: line 1: PK: command not found
/root/Desktop/httpcore.jar: line 2: 6��:: command not found
/root/Desktop/httpcore.jar: line 22: Ġ�:org/PK: No such file or directory
/root/Desktop/httpcore.jar: line 23: Ġ�:
                                        org/apache/PK: No such file or directory
/root/Desktop/httpcore.jar: line 24: Ǡ�:org/apache/http/PK: No such file or directory
/root/Desktop/httpcore.jar: line 25: Ǡ�:org/apache/http/protocol/PK: No such file or directory
/root/Desktop/httpcore.jar: line 26: Ǡ�:org/apache/http/io/PK: No such file or directory
/root/Desktop/httpcore.jar: line 27: Ǡ�:org/apache/http/message/PK: No such file or directory
/root/Desktop/httpcore.jar: line 28: Ǡ�:org/apache/http/entity/PK: No such file or directory
/root/Desktop/httpcore.jar: line 29: Ǡ�:org/apache/http/util/PK: No such file or directory
/root/Desktop/httpcore.jar: line 30: Ǡ�:org/apache/http/params/PK: No such file or directory
/root/Desktop/httpcore.jar: line 31: Ǡ�:org/apache/http/impl/PK: No such file or directory
/root/Desktop/httpcore.jar: line 32: Ǡ�:org/apache/http/impl/io/PK: No such file or directory
/root/Desktop/httpcore.jar: line 33: Ǡ�:org/apache/http/impl/entity/PK: No such file or directory
/root/Desktop/httpcore.jar: command substitution: line 34: unexpected EOF while looking for matching `''
/root/Desktop/httpcore.jar: command substitution: line 38: syntax error: unexpected end of file
/root/Desktop/httpcore.jar: command substitution: line 21: syntax error near unexpected token `)'
/root/Desktop/httpcore.jar: command substitution: line 21: `�R�+'�3=��6�L\�Z���]�^���&�Q�y|x���[�<�'��$�ְ[ ��GZoU�����kM��[���p4IY�������3�ht�qw��3����r�!8����#A^
                      ?P����v��;��Q|�l��p����cl(?jkZ����  Q�9|R���o��R�yH\1=��qtLH�^cBR�s
                    �g��'��
                           N����P�n�*-�p��c4�� (��KҘ#-����1b����ZY�<H��M�?å���>�dą�n'
/root/Desktop/httpcore.jar: line 21:5��:~��ЁMETA-INF/MANIFEST.MF�O�j�0���: No such file or directory
/root/Desktop/httpcore.jar: line 22: syntax error near unexpected token `newline'
/root/Desktop/httpcore.jar: line 22: `~J�"K�Q���M�m7n;<x�A�E��z>h#��Z�L���j�De��}���5��i��e�^���f^�˰H5���腍l(�uD>��[_`�FW�Ph���d!����R�+��K:"�7@)AZV�"r7���5wTXBJ���    v?V>f+�k�F/2�DAfm�p�rtT�iǖ���ȏ�x�4��`��YC<�Q\��ь����B�M�(P.���#��PD�a�F"��l��"����4�u<v���R�܀�Ѧb�l�PFEHJ���$t�����mK��r��7K?�����H�p۷���Y��������f&K��TI�H ������9�S��Ֆ   ���T{�\�3�K����Ǘ�z�'s�+B����@��\j}��E޷�4?b1���ϔs�v�3�J���\�2�`�r
                                                 �"���K��Y3�]a;������u�<��j~�Q��1<Q���`&�
               M�>'

You might want to check the text encoding that you have used to write and save your source code and then when compiling the program you could specify the correct encoding style eg by adding -encoding UTF-8 (according to your encoding type).您可能需要检查用于编写和保存源代码的文本编码,然后在编译程序时您可以指定正确的编码样式,例如通过添加-encoding UTF-8 (根据您的编码类型)。

Reference: http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javac.html参考: http : //docs.oracle.com/javase/7/docs/technotes/tools/windows/javac.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM