[jitsi-dev] source="1.4"-related build problems


#1

Hi all,
I'm trying to build jitsi on Linux (openSUSE) with both openjdk and sun jdk (1.6 and 1.7). Random builds fail with these errors:

\[javac\] 

/usr/src/packages/BUILD/trunk-9014/src/net/java/sip/communicator/launcher/BrowserLauncher.java:62: warning: [deprecation] openURL(java.lang.String) in
com.apple.eio.FileManager has been deprecated
[javac] FileManager.openURL(url);
[javac] ^
[javac]
/usr/src/packages/BUILD/trunk-9014/src/net/java/sip/communicator/launcher/ChangeJVMFrame.java:20:
warning: [serial] serializable class
net.java.sip.communicator.launcher.ChangeJVMFrame has no definition of
serialVersionUID
[javac] public class ChangeJVMFrame
[javac] ^
[javac]
/usr/src/packages/BUILD/trunk-9014/src/net/java/sip/communicator/util/launchutils/LaunchArgHandler.java:332:
for-each loops are not supported in -source 1.4
[javac] (use -source 5 or higher to enable for-each loops)
[javac] for (Handler handler : rootLogger.getHandlers())
[javac] ^
[javac]
/usr/src/packages/BUILD/trunk-9014/src/net/java/sip/communicator/util/Logger.java:48:
generics are not supported in -source 1.4
[javac] (use -source 5 or higher to enable generics)
[javac] public static Logger getLogger(Class<?> clazz)
[javac] ^
[javac]
/usr/src/packages/BUILD/trunk-9014/src/net/java/sip/communicator/util/Logger.java:354:
for-each loops are not supported in -source 1.4
[javac] (use -source 5 or higher to enable for-each loops)
[javac] for (Handler handler : handlers)
[javac] ^
[javac]
/usr/src/packages/BUILD/trunk-9014/src/net/java/sip/communicator/util/launchutils/ArgDelegator.java:42:
generics are not supported in -source 1.4
[javac] (use -source 5 or higher to enable generics)
[javac] private List<String> recordedArgs = new LinkedList<String>();
[javac] ^
[javac]
/usr/src/packages/BUILD/trunk-9014/src/net/java/sip/communicator/util/launchutils/ArgDelegator.java:81:
for-each loops are not supported in -source 1.4
[javac] (use -source 5 or higher to enable for-each loops)
[javac] for (String arg : recordedArgs)
[javac] ^
[javac]
/usr/src/packages/BUILD/trunk-9014/src/net/java/sip/communicator/util/launchutils/SipCommunicatorLock.java:253:
generics are not supported in -source 1.4
[javac] (use -source 5 or higher to enable generics)
[javac] Enumeration<NetworkInterface> interfaces;
[javac] ^
[javac]
/usr/src/packages/BUILD/trunk-9014/src/net/java/sip/communicator/util/ScStdOut.java:55:
annotations are not supported in -source 1.4
[javac] (use -source 5 or higher to enable annotations)
[javac] @Override
[javac] ^
[javac]
/usr/src/packages/BUILD/trunk-9014/src/net/java/sip/communicator/util/launchutils/ArgDelegator.java:42:
type java.util.LinkedList does not take parameters
[javac] private List<String> recordedArgs = new LinkedList<String>();
[javac] ^
[javac]
/usr/src/packages/BUILD/trunk-9014/src/net/java/sip/communicator/util/launchutils/SipCommunicatorLock.java:284:
incompatible types
[javac] found : java.lang.Object
[javac] required: java.net.NetworkInterface
[javac] .nextElement();
[javac] ^
[javac]
/usr/src/packages/BUILD/trunk-9014/src/net/java/sip/communicator/util/launchutils/SipCommunicatorLock.java:295:
incompatible types
[javac] found : java.lang.Object
[javac] required: java.net.InetAddress
[javac] InetAddress addr = loopback.getInetAddresses().nextElement();
[javac] ^
[javac]
/usr/src/packages/BUILD/trunk-9014/src/net/java/sip/communicator/util/launchutils/SipCommunicatorLock.java:454:
type java.util.Enumeration does not take parameters
[javac] Enumeration<NetworkInterface> ifaces;
[javac] ^
[javac]
/usr/src/packages/BUILD/trunk-9014/src/net/java/sip/communicator/util/launchutils/SipCommunicatorLock.java:473:
type java.util.Enumeration does not take parameters
[javac] Enumeration<InetAddress> addreses = iface.getInetAddresses();
[javac] ^
[javac]
/usr/src/packages/BUILD/trunk-9014/src/net/java/sip/communicator/util/launchutils/SipCommunicatorLock.java:735:
type java.util.ArrayList does not take parameters
[javac] ArrayList<String> argsList = new ArrayList<String>();
[javac] ^
[javac]
/usr/src/packages/BUILD/trunk-9014/src/net/java/sip/communicator/util/launchutils/SipCommunicatorLock.java:735:
type java.util.ArrayList does not take parameters
[javac] ArrayList<String> argsList = new ArrayList<String>();
[javac] ^
[javac]
/usr/src/packages/BUILD/trunk-9014/src/net/java/sip/communicator/util/launchutils/SipCommunicatorLock.java:808:
type java.util.Enumeration does not take parameters
[javac] Enumeration<InetAddress> addresses = iface.getInetAddresses();
[javac] ^
[javac] 15 errors
[javac] 6 warnings

After some analysis I found that a little but fundamental part of Jitsi is compiled as java 1.4 version (build.xml, line 300), you can read why in build.xml.

So:
1. files into src/net/java/sip/communicator/launcher/ and files called by these are compiled as java 1.4, but they do contain java 1.4 incompatible expressions (such as generic programming), so the compiler is right. But why does it throw errors in some builds and in others compiles without problems?
2. Really, Java 1.4? I think no one has still it installed (it was released 9 years ago!)

Regards,
Daniel