This forum is in archive mode. You will not be able to post new content.

Author Topic: [Bitch and Moan] - It's programming related :P  (Read 2378 times)

0 Members and 1 Guest are viewing this topic.

xor

  • Guest
[Bitch and Moan] - It's programming related :P
« on: August 22, 2011, 09:48:27 AM »
OK, so it's very rare that I say this, but FUCK YOU JAVA!!


I've had some ups and some downs with Java, most of which has been my lack of competence, or being too lazy to do something, but now.... now.. Java is the one to blame, and oooooh boy am I pissed off!


So I just installed JDK 7, long anticipated, I almost wet my self in excitement. I get the x64 edition for both Windows and Linux and proceed to install it in both locations.


Now the whole idea behind Java, is that the code AND the binary are supposed to be "cross-platform", because it just runs in the Java virtual machine. As long as the target OS has a runtime environment for Java.. it will run.


So I decided that in one of my applications, I was going to add the ability for the program to automatically detect if / when a config file changes, and allow the user to reload it. In Java7 this is relatively easy as demonstrated here:


http://download.oracle.com/javase/tutorial/essential/io/notification.html


http://download.oracle.com/javase/tutorial/essential/io/examples/WatchDir.java


This all looks fine and dandy, until you come to compile that example on both operating systems.... it works on one and not the other, WHAT THE FUCK!


Code: [Select]
import static java.nio.file.StandardWatchEventKinds.*;

Turns out this little bastard is to blame, on windows it's StandardWatchEventKinds and in Linux it's StandardWatchEventKind.

This may only seem like a minor oversight, but they've done a similar thing in all their documentation. In places they mention the Linux version, but all of the documentation points to the StandardWatchEventKinds.

The worst thing about all this is, that I tried to report a bug to sun, but every time to go to do that, the bug report page doesn't load and it's sooooooooo frustrating! >=(


TL;DR: Incompatibilities between Linux and Windows Java Development Kit cause frustration; can't report on Sun's website because the bug report section is broken. FML.
« Last Edit: August 22, 2011, 09:50:43 AM by xor »

Offline Kulverstukas

  • Administrator
  • Zeus
  • *
  • Posts: 6627
  • Cookies: 542
  • Fascist dictator
    • View Profile
    • My blog
Re: [Bitch and Moan] - It's programming related :P
« Reply #1 on: August 22, 2011, 07:56:34 PM »


Shit happens. Don't swear on Java just because of this :P I am starting Java this year :)

Offline Deque

  • P.I.N.N.
  • Global Moderator
  • Overlord
  • *
  • Posts: 1203
  • Cookies: 518
  • Programmer, Malware Analyst
    • View Profile
Re: [Bitch and Moan] - It's programming related :P
« Reply #2 on: September 09, 2011, 10:07:20 PM »
That has nothing to do with your OS, but with the JDK.
You shouldn't use OpenJDK. That is so buggy, no one should use it at all. Use the Sun JDK on both OS and everything is fine. Java is not to blame for that.

Btw. you will find StandardWatchEventKind on the OpenJDK documentation. I guess you only read the Sun API.

Offline gh0st

  • Sir
  • ***
  • Posts: 575
  • Cookies: 8
  • #DEDSec
    • View Profile
Re: [Bitch and Moan] - It's programming related :P
« Reply #3 on: September 10, 2011, 05:21:25 AM »
of how many lines was the source code that you tried to compile?

xor

  • Guest
Re: [Bitch and Moan] - It's programming related :P
« Reply #4 on: September 10, 2011, 05:58:54 AM »
Deque, I did check that, I was running the JDK from sun on both machines. And I made sure that I was using the same on both using --version. It was only a handful of lines, approximately 16 just to test a feature, but it wouldn't compile because of this. I might update today and see if they've fixed it.
« Last Edit: September 10, 2011, 06:00:44 AM by xor »

Offline Deque

  • P.I.N.N.
  • Global Moderator
  • Overlord
  • *
  • Posts: 1203
  • Cookies: 518
  • Programmer, Malware Analyst
    • View Profile
Re: [Bitch and Moan] - It's programming related :P
« Reply #5 on: September 10, 2011, 06:43:33 PM »
Deque, I did check that, I was running the JDK from sun on both machines. And I made sure that I was using the same on both using --version. It was only a handful of lines, approximately 16 just to test a feature, but it wouldn't compile because of this. I might update today and see if they've fixed it.
In that case it really is a bad bug.  :(

xor

  • Guest
Re: [Bitch and Moan] - It's programming related :P
« Reply #6 on: September 10, 2011, 08:46:59 PM »
Still the same issue, but Sun finally fixed their bug report link, so I've submitted it now :)

 



Want to be here? Contact Ande, Factionwars or Kulverstukas on the forum or at IRC.