How to fix Netbeans 8.0 not detecting Java ME

佐手、 提交于 2020-01-24 19:33:15

问题


I am trying to set up NetBeans 8.0 for development in Java ME (I know this is legacy software, but it is the only software I know of that supports Java ME), however, NetBeans will not detect my Java ME platform in the platform manager any time I try to load it. You can view this error here. My version of Java is 1.8.0_201. The log from the Java ME SDK reads:

[2019-02-16 09:20:12.444] INFO - lkit.bootstrap.DeployerManager - Registering custom property editors [2019-02-16 09:20:12.463] INFO - me.toolkit.bootstrap.Namespace - Starting batch, base module object-server [2019-02-16 09:20:12.476] INFO - bootstrap.ObjectGraphProcessor - Consolidating dependencies... [2019-02-16 09:20:12.476] INFO - bootstrap.ObjectGraphProcessor - Consolidated dependencies... [2019-02-16 09:20:12.477] INFO - bootstrap.ObjectGraphProcessor - Calculating order... [2019-02-16 09:20:12.477] INFO - bootstrap.ObjectGraphProcessor - Calculated order [2019-02-16 09:20:12.494] INFO - un.jme.toolkit.bootstrap.Batch - Initializing objects... [2019-02-16 09:20:12.495] INFO - un.jme.toolkit.bootstrap.Batch - Applying I18N [2019-02-16 09:20:12.495] INFO - un.jme.toolkit.bootstrap.Batch - Initialized objects [2019-02-16 09:20:12.495] INFO - un.jme.toolkit.bootstrap.Batch - Calling create() methods... [2019-02-16 09:20:12.496] INFO - un.jme.toolkit.bootstrap.Batch - Calling start() methods... [2019-02-16 09:20:12.503] INFO - un.jme.toolkit.bootstrap.Batch - Objects started [2019-02-16 09:20:12.506] INFO - me.toolkit.bootstrap.Namespace - Starting batch, base module process/device-manager [2019-02-16 09:20:12.536] INFO - bootstrap.ObjectGraphProcessor - Consolidating dependencies... [2019-02-16 09:20:12.537] INFO - bootstrap.ObjectGraphProcessor - Consolidated dependencies... [2019-02-16 09:20:12.537] INFO - bootstrap.ObjectGraphProcessor - Calculating order... [2019-02-16 09:20:12.538] INFO - bootstrap.ObjectGraphProcessor - Calculated order [2019-02-16 09:20:12.865] INFO - un.jme.toolkit.bootstrap.Batch - Initializing objects... [2019-02-16 09:20:12.914] INFO - un.jme.toolkit.bootstrap.Batch - Applying I18N [2019-02-16 09:20:12.915] INFO - un.jme.toolkit.bootstrap.Batch - Initialized objects [2019-02-16 09:20:12.915] INFO - un.jme.toolkit.bootstrap.Batch - Calling create() methods... [2019-02-16 09:20:12.919] INFO - un.jme.toolkit.bootstrap.Batch - Calling start() methods... [2019-02-16 09:20:12.959] ERROR - sun.kvem.tools.http.HttpServer - java.net.BindException: Address already in use: JVM_Bind java.net.BindException: Address already in use: JVM_Bind at java.net.DualStackPlainSocketImpl.bind0(Native Method) at java.net.DualStackPlainSocketImpl.socketBind(DualStackPlainSocketImpl.java:106) at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:387) at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:190) at java.net.ServerSocket.bind(ServerSocket.java:375) at java.net.ServerSocket.bind(ServerSocket.java:329) at com.sun.kvem.tools.http.HttpServer.createServerSocket(Unknown Source) at com.sun.kvem.tools.http.HttpServer.run(Unknown Source)

I've tried many answers to this on many forums including this one, but none of them have worked. Any help is appreciated.


回答1:


Your problem is not trivial to fix, and this is not a solution - it is more of an update for your problem since it is is too large for a comment:

First note that the cause of the failure to add Java ME as a platform within NetBeans is shown in the stack trace: java.net.BindException: Address already in use: JVM_Bind.

Oracle mention the possibility of getting this exception in many places in their Java ME documentation. For example:

7.2.1 Troubleshooting Device Connection Issues

If the IP address of a device with a running Java ME Embedded runtime instance is not available in the corresponding drop-down list when adding a device connection, see the Device Manager log file. It is located under logs in the Oracle Java ME SDK configuration directory.

The Device Connection log file (device-manager.log) contains errors, warnings, and informational events that you can review in order to find the cause of the problem. The following are some of the common messages that you may encounter:

WARN - .vmagent.proxy.DeviceDetection - UDP device detection failed java.net.BindException: Address already in use: Cannot bind

Cause: The device detection ports are used by another application on the host computer. By default, these ports are 55208 and 55209.

Action: The best solution is to stop the application that uses these ports or configure it to use different ports. Alternatively, you can configure the device and Device Manager to use different ports as follows:

  1. Change the ports specified by the proxy.udp_device_detection_request_port and proxy.udp_device_detection_response_port properties in jwc_properties.ini on the device.

  2. Create a file named proxyOptions.txt under toolkit-lib/lib in the Oracle Java ME SDK installation directory and add the following line to it:

-bcastports <request> <response>

The <request> and <response> port numbers must match those specified in the device properties (see Step > 1).

Since the default ports used by Device Manager are 55208 and 55209 you can check whether those ports are already being used:

  • Open a Command Prompt window.
  • Submit netstat -aon | findstr 55208 and netstat -aon | findstr 55209.

If the two calls to netstat return nothing then the ports are available. Otherwise those ports are already in use and you need to find out why, by checking the PIDs that are displayed for the ports in use.

Alternatively, just assign different port numbers, as described in Oracle's documentation shown above. If you are going to do that, first verify that the new port numbers are available using netstat. For example, if you want to use port 55210, call netstat -aon | findstr 55210. If no other process is using that port then netstat will return nothing.


Update:

The following approach worked for me:

  • Select Tools > Java Platforms > Add Platform...
  • Click the Add Platform... button and select radio button Custom Java ME CLDC Platform Emulator and click Next >.
  • Click the Browse... button and navigate to your Java ME folder (e.g. "...\Java_ME_platform_SDK_8.0").
  • Click Next > then Next > then Finish.



来源:https://stackoverflow.com/questions/54717322/how-to-fix-netbeans-8-0-not-detecting-java-me

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