heyanthony / jmonkeyengine

Automatically exported from code.google.com/p/jmonkeyengine
0 stars 0 forks source link

NetBeans 8.0.1 and JDK 1.8 #645

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
In NetBeans 8.0.1 I installed JME3 per the instructions at 
http://hub.jmonkeyengine.org/wiki/doku.php/jme3:build_jme3_sources_with_netbeans
.

A couple of things came up:

1) lots of warnings about missing libraries. I followed the list and manually 
did an "Add JAR/Folder" for a bunch of entries that weren't already added. (A 
bunch were there, though; odd.) See the screenshot; the highlited entries are 
what I added by hand.

2) With those added, I came across an error in 
com.jme3.network.kernel.udp.UdpEndpoint.jave; NetBeans complained about the 
catch of IOException at line 130. At first I "fixed" this by just catching an 
Exception. That seemed to work. Then I realized that JME3 was mostly JDK 1.5; I 
modified the project's Library settings to use JDK 1.6 (which is what I had) 
and went back to catching the IOException; this now worked.

Summary: the constructor for DatagramPacket in JDK 1.8 (and perhaps JDK 1.7?) 
doesn't throw an IOException like it did in 1.[56] and NetBeans 8.x catches 
this as an error. Since Java doesn't have conditional compilation, one "fix" is 
to catch the more generic Exception instead of IOException. If there is an 
annotation strategy or other workaround, perhaps that should be employed.

Original issue reported on code.google.com by Uncl...@gmail.com on 24 Oct 2014 at 2:51

Attachments: