Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/358.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 虚拟机中的本地主机地址_Java_Linux_Networking_Jmf - Fatal编程技术网

Java 虚拟机中的本地主机地址

Java 虚拟机中的本地主机地址,java,linux,networking,jmf,Java,Linux,Networking,Jmf,我正在服务器上使用虚拟机。 我的虚拟机本地IP是192.168.1.10 我正在尝试实现一些要求我编辑此链接中提供的/etc/hosts的功能 我的控制台显示,我也有类似的问题 RTP--- :DataAddress: /192.168.1.10 ControlAddress: /192.168.1.10 DataPort: 42050 ControlPort: 42051 java.io.IOException: Local Data AddressDoes not belong to an

我正在服务器上使用虚拟机。 我的虚拟机本地IP是
192.168.1.10

我正在尝试实现一些要求我编辑此链接中提供的
/etc/hosts
的功能

我的控制台显示,我也有类似的问题

RTP--- :DataAddress: /192.168.1.10
ControlAddress: /192.168.1.10
DataPort: 42050
ControlPort: 42051
java.io.IOException: Local Data AddressDoes not belong to any of this hosts local interfaces
java.io.IOException: Local Data AddressDoes not belong to any of this hosts local interfaces
at org.speechforge.cairo.rtp.RTPConsumer.init(RTPConsumer.java:181)
    at org.speechforge.cairo.rtp.RTPConsumer.<init>(RTPConsumer.java:95)
    at org.speechforge.cairo.rtp.server.RTPStreamReplicator.<init>    (RTPStreamReplicator.java:69)
那么,我应该用我的
192.168.1.10

或者我应该创建一个别名,比如
127.0.0.1/192.168.1.10

或者我应该把
192.168.1.10
粘贴到顶部作为

192.168.1.10
127.0.0.1    localhost
127.0.1.1       SparkVM104
感谢您的帮助


关于。

关于
/etc/hosts
的格式是

IP_address canonical_hostname [aliases...]
(请参阅),因此要首先列出192.168.1.10,文件
/etc/hosts
必须如下所示:

192.168.1.10    SomeHostName    SomeOtherHostName
127.0.0.1       localhost    

在/etc/hosts中,localhost应该映射到127.0.0.1,而不是别的,外部主机名映射到外部IP地址,而不是别的。某些Linux发行版违反了此规则,它破坏了一切。

您的建议与引用不一致。引用中的示例显示了映射到
127.0.0.1
localhost
,以及映射到外部IP地址的外部主机名。这是有效的配置。你的不会。我重新阅读了手册页,没有找到一段明确指出禁止在环回接口中使用别名的段落。它实际上可以在Ubuntu 11.10和MacOS X 10.7上运行。尽管如此,我还是改变了这个例子,因为我明白你的意思,希望能有一个指向讨论这个问题的某种文档或RFC的指针。快速的谷歌搜索并不是很成功。
192.168.1.10    SomeHostName    SomeOtherHostName
127.0.0.1       localhost