-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to compile under MacOS Big Sur #45
Comments
Hi.
"javac" is the Java compiler. Do you have a JDK (Java Development Kit)
installed on your machine? That should include javac, among other
development tools.
If you do, maybe it's installing javac in a different location? I can't
check myself, as I don't have a mac.
Cheers,
Phil
…On Thu, 24 Dec 2020 at 12:44, Danut Soare ***@***.***> wrote:
The following error is generated when compile from source under MacOS Big
Sur:
$ make -C salma-hayek
Compiling Java source...
rm -f -r classes && rm -f -r .generated/classes && mkdir -p .generated/classes
/usr/Commands/javac -classpath /Users/danut/Downloads/terminator/jessies/salma-hayek/.generated/classes -encoding UTF-8 -d .generated/classes/ -sourcepath src/ -g -deprecation -Xlint:all -Xlint:-serial -target 8 -source 8 -bootclasspath /Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre/lib/rt.jar $(JAVA_SOURCE_FILES)
/bin/sh: /usr/Commands/javac: No such file or directory
make[1]: *** [/Users/danut/Downloads/terminator/jessies/salma-hayek/.generated/java.build-finished] Error 127
make: *** [recurse] Error 1
I've tried to create the missing folder(as root) but it seems that I don't
have enough privileges!
sudo mkdir -p /usr/Commands
mkdir: /usr/Commands: Operation not permitted
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#45>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE6TQTPLV72IWGD5WLFGTMDSWMSQ7ANCNFSM4VIDZSDQ>
.
|
Hi Phil, I do have JDK kit installed and JAVA_HOME also set. It seems to point to other location than script wants.
I will try to find the file that point to the wrong location and change it. Regards, |
Hi, I've solve it with:
BR, |
Yikes. It wasn't intended that you do that.
It wasn't intended that you do that. jessies/salma-hayek/bin/find-jdk-root.rb Line 46 in 9612492
I don't think that's the first place that our code has taken a wrong turning, so I wouldn't do that. From your output, it seems that find-jdk-root.rb found /usr/bin/javac, stripped off the last two components and returned /usr, just like it would on eg the more familiar-to-us Linux. Then jessies/salma-hayek/lib/build/universal.make Line 151 in 9612492
The assumption for macOS at jessies/salma-hayek/lib/build/universal.make Line 147 in 9612492
JDK_INCLUDE.Darwin = /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/ I wonder where yours is instead. I doubt it's in /usr/include, which is what would be assumed if you commented that line out too, because that would have Just Worked already. If you conquer that barrier, I expect you'll have another, looking for jni_md.h, which is handled for other platforms with EXTRA_INCLUDE_PATH.$(TARGET_OS) assignments starting at: jessies/salma-hayek/lib/build/universal.make Line 326 in 9612492
Last we had a record of it working in the revision history of that file suggests it was macOS 10.14 == Mojave. jessies/salma-hayek/lib/build/universal.make Line 551 in 9612492
Ceto:~ ukdev$ ls -l /usr/bin/javac ... where: /System/Library/Frameworks/JavaVM.framework/Versions/Current -> A |
Hi,
I've used the JDK version 1.8.
Using Java 11 gives me the same message:
Thank you! |
this works for me (though i now don't have access to an older macOS if you want to check it still works there):
the good news though is that this mostly removes mac-specific cruft. i've deleted BOOT_JDK_ERROR and the "feel free" comment because it seems like someone already checked in that change and just didn't update the comment, and if no-one's noticed i'm assuming we can live without that stuff. fwiw, i'm still seeing that warning on macOS even with this change, but it doesn't seem to make any difference? do we actually need this any more? (i've long since forgotten what this -bootclasspath stuff was for, or even whether i ever knew.) |
You, in 48c5e21, without much explanation.
It started being treated as an error with cdce383, which links to an explanation in the review comments of e036dfa. It was to stop anyone from fixing warnings that broke compatibility with Java 6. Java 6 compatibility has since gone but presumably the analogous issue now would be that you'd make changes to fix warnings produced by Java 11 or Java 13 or whatever and break compilation for Java 8. Guess I should have generalized the elaborated warning rather than removing it in 2b39c06. |
oh. that confirms my suspicion that whoever it was had checked it in by accident then... :-)
the thing i should have added was that "there is no rt.jar in macOS 11's Java 11". nor, apparently, though i hadn't noticed until now, is there an rt.jar in my Debian Java 11... |
Yeah, Java 9 got rid of rt.jar, but the intent here is not that you use a Java 11 rt.jar, but a Java 8 one. Then you can compile with Java 11 and fix warnings with impunity. |
my assumption was that anyone on Debian stale^Wstable or otherwise restricted to an LTS Java will still be screwed because they'll be on Java 11 for 6-7 years (and this trick won't work then because there's no rt.jar in 11)? (i'm assuming from the lack of a newer LTS than 11 in https://www.oracle.com/java/technologies/java-se-support-roadmap.html that upstream has no plan for another LTS until the current one is really really old, like last time, rather than the Ubuntu style of fairly frequent LTS releases.) i think the bit i don't get/remember is why we're dicking about with rt.jar rather than just using -source/-target? as far as i can tell from https://docs.oracle.com/en/java/javase/11/tools/javac.html they haven't broken that [again, since they removed Java 5 and earlier from the list]? |
The lack of rt.jar in Java 11 won’t be relevant until we switch our minimum supported version from 8 to 11. Last time I looked at the upstream situation, it appeared 8 will last longer than 11. We already use -source and -target. It wasn’t enough, as demonstrated in the links I posted here before. |
/me re-reads https://www.oracle.com/java/technologies/java-se-support-roadmap.html ... oh, yeah. wow. maybe golang or rust will have gotten their shit together for cross-platform ui by then? nah, probably not.
ah, because these have been library issues, not language issues. yeah, this is what should have been in the how do you want to go forward? does anyone have a pre-Big Sur mac that we'd need to keep compatibility with? or do we want basically the patch above plus a patch that explains why we're nagging about Java 8? |
Not that I know of... and no one's chimed in to say your patch worked or didn't for them.
I'm keen. If it's too hard to get the Java 8 rt.jar on the Mac (even with wget ... tar ..., put it exactly and we'll do the right thing?), then I'd certainly settle for an improved warning rather than an error. |
He's done it in 41eb995. LGTM, thanks. I guess that's this closed, unless the OP wants to tell us otherwise? |
The following error is generated when compile from source under MacOS Big Sur:
I've tried to create the missing folder(as root) but it seems that I don't have enough privileges!
The text was updated successfully, but these errors were encountered: