Java is on crack
-
Excerpt from maven build of some project I am trying to compile. This is the start of
[ERROR]
s. There is 301 of them.[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:1.0.0:compile (default-compile) on project com.wtfcorp.wtfproj.whatever: Compilation failure: Compilation failure: [ERROR] /home/silly/eclipse-workspace/wtfproj/Whatever/com.wtfcorp.wtfproj.whatever/src/com/wtfcorp/wtfproj/whatever/bundleentryfs/BundleFileSystem.java:[1] [ERROR] /** [ERROR] ^ [ERROR] The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files [ERROR] /home/silly/eclipse-workspace/wtfproj/Whatever/com.wtfcorp.wtfproj.whatever/src/com/wtfcorp/wtfproj/whatever/bundleentryfs/BundleFileSystem.java:[1] [ERROR] /** [ERROR] ^ [ERROR] The type java.lang.Comparable cannot be resolved. It is indirectly referenced from required .class files [ERROR] /home/silly/eclipse-workspace/wtfproj/Whatever/com.wtfcorp.wtfproj.whatever/src/com/wtfcorp/wtfproj/whatever/bundleentryfs/BundleFileSystem.java:[1] [ERROR] /** [ERROR] ^ [ERROR] The type java.net.URL cannot be resolved. It is indirectly referenced from required .class files [ERROR] /home/silly/eclipse-workspace/wtfproj/Whatever/com.wtfcorp.wtfproj.whatever/src/com/wtfcorp/wtfproj/whatever/bundleentryfs/BundleFileSystem.java:[1] [ERROR] /** [ERROR] ^ [ERROR] The type java.lang.String cannot be resolved. It is indirectly referenced from required .class files [ERROR] /home/silly/eclipse-workspace/wtfproj/Whatever/com.wtfcorp.wtfproj.whatever/src/com/wtfcorp/wtfproj/whatever/bundleentryfs/BundleFileSystem.java:[1] [ERROR] /** [ERROR] ^ [ERROR] The type java.util.Enumeration cannot be resolved. It is indirectly referenced from required .class files [ERROR] /home/silly/eclipse-workspace/wtfproj/Whatever/com.wtfcorp.wtfproj.whatever/src/com/wtfcorp/wtfproj/whatever/bundleentryfs/BundleFileSystem.java:[7] [ERROR] import java.io.IOException; [ERROR] ^^^^^^^
(only anonymisation was changing the source path and package name)
Can you guess the cause?
It is because I tried to compile it under Java 11 instead of Java 8. It builds fine under Java 8. Backward compatibility, anyone?
-
@Bulb It's nice how it helpfully points towards the beginning of a comment as the source of all problems.
-
@Rhywden Only for the first few. The last one included in the sample (and many following) point to imports from standard packages. Then there are some pointing to standard annotation
@Override
… But I couldn't find any useful hint towards what is actually misconfigured there.
-
@Bulb IIRC I've seen similar things with previous versions. I forget the details but I got some unhelpful error, and found on Google that it was due to a mismatch in some magic number somewhere.
-
The I Hate Oracle club is
yeah, it probably wasn't their fault, but is there a difference between the WTFery of Java and Oracle?
-
If the build had been done in the past on java 8 and the building machine then got upgraded and tried to build without a clean, that could cause version mismatches. But usually later versions can consume older class files but seems since 7 not the other way. Weird.
-
@CHUDbert Well, it's OpenJDK, so it's not completely Oracle's fault.
-
@mikehurley said in Java is on crack:
If the build had been done in the past on java 8 and the building machine then got upgraded and tried to build without a clean, that could cause version mismatches. But usually later versions can consume older class files but seems since 7 not the other way. Weird.
It was squeaky clean. The machine is a new container from ubuntu:bionic with just the necessary tools installed and clean checkout mounted in it. So no, there can't be any remnants from an upgrade.
-
@Bulb said in Java is on crack:
The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
Huh. That's a bad one, as it indicates that the root of the whole class system is missing, which is a crazy case. Sounds like you've either got your classpath completely wrong or a compiler plugin of some kind doesn't work with Java 11 and is causing things to break horribly. The latter is sort of likely as 11 tightened up a whole load of things in class loading and visibility over 8 as part of the Project Jigsaw modules system.
I suspect it's a compiler plugin/instrumentation thing as I don't get anything like that when building (from scratch) some very vanilla code with 11. The only difference I observe in my builds is some annoying warnings when doing a javadoc build (as there's a few places where 11 is definitely stricter there; that's definitely not your problem right now though).
-
Hooray for Project Jigsaw. The system nobody asked for that does none of what you want a module system to and breaks lots of existing code. The Oracle Way™.
-
@dkf said in Java is on crack:
compiler plugin of some kind doesn't work with Java 11 and is causing things to break horribly
This, yes. It works with OpenJDK 8, it breaks completely with OpenJDK 11. No other changes, just plain install of one or the other. It uses the Tycho compiler module, whatever the hell it is (I don't normally work in Java, and less so with Eclipse plugins, so I don't know it).
-
@pie_flavor said in Java is on crack:
Hooray for Project Jigsaw. The system nobody asked for that does none of what you want a module system to and breaks lots of existing code. The Oracle Way™.
Did they move
java.lang.Object
toOracle.Object
or what?Filed under: I wouldn't even be surprised.
-
@topspin No, but it is in the
java.base
module.
If you were asking about breakage: Non-public anything is not exposed to any other module through any means, including reflection. Also they broke classloading again which is why Minecraft is still on Java 8.
-
@pie_flavor said in Java is on crack:
Minecraft is still on Java 8
It's not the only thing that is. Almost everything is still on Java 8. Except Android. Android never got past Java 6.
-
@Bulb and just to make absolute sure that this will stay the case, Oracle did the JVM licensing thing. It's like they're trying to make people take advantage of .NET 5's Java support.
-
@pie_flavor said in Java is on crack:
Hooray for Project Jigsaw. The system nobody asked for that does none of what you want a module system to and breaks lots of existing code. The Oracle Way™.
A module system for java was a highly requested feature.
Breaking stuff was a lot less requested, but hey, it's about time Java started breaking stuff.
-
@pie_flavor said in Java is on crack:
@topspin No, but it is in the
java.base
module.
If you were asking about breakage: Non-public anything is not exposed to any other module through any means, including reflection. Also they broke classloading again which is why Minecraft is still on Java 8.Just for clarification: they did actually move
Object
? And that's somehow supposed to not break absolutely everything?
-
@pie_flavor said in Java is on crack:
.NET 5's Java support.
WHAT!? Goddamn, that would be the best thing ever.
*le Google*
So, apparently they made an announcement it will be a thing, but they provided zero details on how it would work and what would actually be possible to do with it. And it's going to be released in late 2020. Plenty of time for Microsoft to fuck this up.
-
@topspin
java.base
module, not package.
-
@Carnage said in Java is on crack:
A module system for java was a highly requested feature.
Yeah, but a real one. This one doesn't have versions, and doesn't auto-load dependencies, and still cares about packages for some reason.
-
-
-
-
@topspin said in Java is on crack:
@pie_flavor said in Java is on crack:
@topspin No, but it is in the
java.base
module.
If you were asking about breakage: Non-public anything is not exposed to any other module through any means, including reflection. Also they broke classloading again which is why Minecraft is still on Java 8.Just for clarification: they did actually move
Object
? And that's somehow supposed to not break absolutely everything?They moved its physical location on disk. It used to be in the JDK's rt.jar and now it's in java.base.jmod
If you use a compiler tool that needs to know its physical location, then it will definitely need to be upgraded.
Edit:
Incidentally, the tycho-compiler is up to version 1.4.0 now released earlier this year. Any version 1.1.0 or newer should fix the problem where it can't locate java.lang.Object
-
@powerlord said in Java is on crack:
Incidentally, the tycho-compiler is up to version 1.4.0 now released earlier this year. Any version 1.1.0 or newer should fix the problem where it can't locate java.lang.Object
That's probably It™:
org.eclipse.tycho:tycho-compiler-plugin:1.0.0:compile
-
@Tsaukpaetra said in Java is on crack:
@Gąska said in Java is on crack:
I'm getting slow in my old age.
The three problems of getting old:
-
Every thing takes more time;
-
Forgetfulness;
-
-
@Zecc You forgot:
-
GET OFF MY LAWN!
-
@CHUDbert said in Java is on crack:
@Zecc You forgot:
-
GET OFF MY LAWN!
-
@levicki I don't like Java, but it's usually OK. It just badly mishandled the backward compati(de)bility this time. It is in good company though. Breaking backward compati(de)bility seems to be all the rage for programming languages lately (D Phobos/Tango/2 schism, Python 2/3 schism, .NET Core fork, Swift not even trying…).
-
@Bulb said in Java is on crack:
D Phobos/Tango/2 schism
I thought it was solved long ago?
@Bulb said in Java is on crack:
Python 2/3 schism
Fortunately, after many many years, Python 2 is mostly gone now.
@Bulb said in Java is on crack:
.NET Core fork
They're merging next year.
@Bulb said in Java is on crack:
Swift not even trying…
This I am thankful for.
All in all, things are getting better - they'll soon be almost good.
-
@Gąska MacOS still comes with Python 2.7 installed.
-
@Gąska said in Java is on crack:
@Bulb said in Java is on crack:
D Phobos/Tango/2 schism
I thought it was solved long ago?
Kinda. It effectively sent the language into oblivion.
@Bulb said in Java is on crack:
Python 2/3 schism
Fortunately, after many many years, Python 2 is mostly gone now.
Is it? Python 2 is still default in Debian, Ubuntu, and many other places.
@Bulb said in Java is on crack:
.NET Core fork
They're merging next year.
Wow, Microsoft managed to restore some common sense. That's… actually pretty good news.
@Bulb said in Java is on crack:
Swift not even trying…
This I am thankful for.
All in all, things are getting better - they'll soon be almost good.
So now Java has taken over the flag. That's… getting better too, because it will make more people switch to, usually, Go. I don't really like that either, but it is quite a bit more efficient—specifically in memory consumption—and lot less verbose. And as a bonus the Java-style behemoths will get rewritten to more modular services. So that's overall win too.
-
@Benjamin-Hall said in Java is on crack:
@Gąska MacOS still comes with Python 2.7 installed.
@Bulb said in Java is on crack:
@Bulb said in Java is on crack:
Python 2/3 schism
Fortunately, after many many years, Python 2 is mostly gone now.
Is it? Python 2 is still default in Debian, Ubuntu, and many other places.
I meant mostly gone, as in you don't have to use it for new applications due to lack of library support, as was the case this past decade - not that the old runtime isn't used at all.
Source: https://www.jetbrains.com/research/python-developers-survey-2018/
-
@Bulb said in Java is on crack:
Wow, Microsoft managed to restore some common sense. That's… actually pretty good news.
It's going to be called .Net 5 for the same reason there was no Windows 9.
-
@Zecc why would be it called anything but 5 if the previous one is 4?
-
@Gąska said in Java is on crack:
@Zecc why would be it called anything but 5 if the previous one is 4?
Well, from the .Net Framework's point of view yes.
But there is no .Net Core 4 or .Net Standard 3. And there won't ever be.And that's very sensible.
-
@Zecc said in Java is on crack:
But there is no .Net Core 4 or .Net Standard 3.
-
@Gąska I was mainly ragging on Apple.
-
@Zecc said in Java is on crack:
But there is no .Net Core 4 or .Net Standard 3. And there won't ever be.
Never say never
-
@Bulb said in Java is on crack:
Is it? Python 2 is still default in Debian, Ubuntu, and many other places.
python
will always launch Python 2 because otherwise it would break old scripts (using metadata to choose the correct one? That's crazy talk).
-
@anonymous234 said in Java is on crack:
@Bulb said in Java is on crack:
Is it? Python 2 is still default in Debian, Ubuntu, and many other places.
python
will always launch Python 2 because otherwise it would break old scriptsExcept when it does not.
It is actually a Debian thing. Because Debian does care about backward compatibility a lot. I've seen environments where python points to python3. Also on Windows both Ptyhon 2 and 3 have the same binary name (installed in different directories).
(using metadata to choose the correct one? That's crazy talk).
What is metadata?
There is exactly nothing to tell you whether a script should be executed in python 2 or 3. See, Unix has at least it's shebang, but because there are some installation where
python
means python3, you can't be sure. And Windows have Nothing™.
-
@Bulb said in Java is on crack:
There is exactly nothing to tell you whether a script should be executed in python 2 or 3
Yes, that's the problem.
-
@Bulb said in Java is on crack:
And Windows have Nothing™
Right, because we use file extensions instead.
-
@levicki said in Java is on crack:
@Gąska said in Java is on crack:
@Zecc why would be it called anything but 5 if the previous one is 4?
They should just call it .NET Framework 10 and have it have the same build number like the current OS patch.
.Net 24 - the sum of all suported OSes.
-
@levicki did they factor them in?
-
@levicki said in Java is on crack:
They should just call it .NET Framework 10 and have it have the same build number like the current OS patch.
But that would imply existing .NET Framework web apps could upgrade, and they can't. This is really the next version of .NET Core.
-
@levicki said in Java is on crack:
And here I was weeks ago discussing a file system which would use mime types stored in metadata. If we had that, they could tag old scripts as python2 and new as python3 without changing file name or content and always execute using the right python version.
That's no different from file extensions, except there would be a little less pressure for abbreviating. If they didn't change the extension, they wouldn't have changed the mime-type either.
Also having a filesystem store mime-types would, alone, be useless. You'd need all of them to do it and all applications to copy them around, including for transfers over the network. Which will never happen, because the fundamental abstraction is just stream of bytes and there will always be some transfer methods that for whatever reason don't go beyond that. So the only information you reliably have is the information within the content of the file itself.
Not to mention many data formats are specialization of other formats, which mime types don't really capture properly, and some can be handled in multiple ways altogether, which mime types don't help with at all.
-
@anonymous234 said in Java is on crack:
@Bulb said in Java is on crack:
There is exactly nothing to tell you whether a script should be executed in python 2 or 3. See, Unix has at least it's shebang, but because there are some installation where python means python3, you can't be sure. And Windows have Nothing™.
Yes, that's the problem.
If only it were possible to write python2 or python3 in the shebang, and if there were some sort of "Python Launcher for Windows"...
-
@Zecc said in Java is on crack:
there were some sort of "Python Launcher for Windows"
which, oddly, doesn't seem to like associating itself as the default for py files. I'm sure there's an excellent reason for that.
-
@Zecc said in Java is on crack:
If only it were possible to write python2 or python3 in the shebang
If only it were possible to write:
#!/usr/bin/env python2
or
#!/usr/bin/env python3