Closed
Bug 1445729
Opened 8 years ago
Closed 5 years ago
Force sdkmanager to use Java 8 in bootstrap for mobile/android
Categories
(Firefox Build System :: Bootstrap Configuration, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: kats, Unassigned, Mentored)
References
Details
(Keywords: good-first-bug)
Attachments
(1 file)
|
7.95 KB,
text/plain
|
Details |
I tried running mach bootstrap for a Android gecko build on my Macbook Pro (pretty new, doesn't have any Android stuff on it yet), but the bootstrap failed.
Full log attached, but the error part appears to be this:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
at com.android.sdklib.tool.SdkManagerCli.main(SdkManagerCli.java:117)
at com.android.sdklib.tool.SdkManagerCli.main(SdkManagerCli.java:93)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:185)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
... 5 more
Comment 1•8 years ago
|
||
This is a Java 9 issue: https://stackoverflow.com/questions/46402772/failed-to-install-android-sdk.
I thought I worked around this with https://bugzilla.mozilla.org/show_bug.cgi?id=1427790, and indeed I se
Flags: needinfo?(bugmail)
| Reporter | ||
Comment 2•8 years ago
|
||
I guess it might be picking up my macOS-installed java:
$ which java
/usr/bin/java
$ java --version
java 9.0.4
Java(TM) SE Runtime Environment (build 9.0.4+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.4+11, mixed mode)
Flags: needinfo?(bugmail)
Comment 3•8 years ago
|
||
Yep. Changing description to match what needs to be fixed. Thanks, kats -- this will start biting more people as the newer macOS versions roll out.
Summary: Bootstrap failed for Android build setup → Force sdkmanager to use Java 8 in bootstrap for mobile/android
Comment 4•8 years ago
|
||
This is a good first or second bug for somebody who knows Python, and preferably has access to a (newish) macOS device. Around
https://searchfox.org/mozilla-central/rev/8976abf9cab8eb4661665cc86bd355cd08238011/python/mozboot/mozboot/android.py#245
we need to force the sdkmanager invocation to use Java 8 (which we probably just installed). We might start by looking for Java 8 in known locations (wherever bootstrap put it), and then try to version-check whatever we find by default so that we don't even try with Java 9.
Mentor: nalexander
Keywords: good-first-bug
| Reporter | ||
Comment 5•8 years ago
|
||
Weird thing is I can't find the actual Java 8 installation. The Caskroom just has .pkg files:
$ find /usr/local/Caskroom/ -type f
/usr/local/Caskroom//java8/.metadata/1.8.0_162-b12,0da788060d494f5095bf8624735fa2f1/20180314184639.181/Casks/java8.rb
/usr/local/Caskroom//java8/1.8.0_162-b12,0da788060d494f5095bf8624735fa2f1/JDK 8 Update 162.pkg
/usr/local/Caskroom//java/.metadata/9.0.4,11:c2514751926b4512b076cc82f959763f/20180306184448.837/Casks/java.rb
/usr/local/Caskroom//java/9.0.4,11:c2514751926b4512b076cc82f959763f/JDK 9.0.4.pkg
and there's no java binaries anywhere else in /usr/local/. The /usr/bin/java is a symlink:
$ ls -al $(which java)
lrwxr-xr-x 1 root wheel 74 22 Feb 14:08 /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java
but there's no other versions installed their either:
$ ls -al /System/Library/Frameworks/JavaVM.framework/Versions/
total 0
drwxr-xr-x 4 root wheel 128 22 Feb 14:09 .
drwxr-xr-x 8 root wheel 256 26 Feb 20:39 ..
drwxr-xr-x 10 root wheel 320 26 Feb 20:39 A
lrwxr-xr-x 1 root wheel 1 22 Feb 14:06 Current -> A
Do you know where the installation is supposed to end up?
Comment 6•8 years ago
|
||
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #5)
> Weird thing is I can't find the actual Java 8 installation. The Caskroom
> just has .pkg files:
>
> $ find /usr/local/Caskroom/ -type f
> /usr/local/Caskroom//java8/.metadata/1.8.0_162-b12,
> 0da788060d494f5095bf8624735fa2f1/20180314184639.181/Casks/java8.rb
> /usr/local/Caskroom//java8/1.8.0_162-b12,0da788060d494f5095bf8624735fa2f1/
> JDK 8 Update 162.pkg
> /usr/local/Caskroom//java/.metadata/9.0.4,11:
> c2514751926b4512b076cc82f959763f/20180306184448.837/Casks/java.rb
> /usr/local/Caskroom//java/9.0.4,11:c2514751926b4512b076cc82f959763f/JDK
> 9.0.4.pkg
>
> and there's no java binaries anywhere else in /usr/local/. The /usr/bin/java
> is a symlink:
>
> $ ls -al $(which java)
> lrwxr-xr-x 1 root wheel 74 22 Feb 14:08 /usr/bin/java ->
> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java
>
> but there's no other versions installed their either:
>
> $ ls -al /System/Library/Frameworks/JavaVM.framework/Versions/
> total 0
> drwxr-xr-x 4 root wheel 128 22 Feb 14:09 .
> drwxr-xr-x 8 root wheel 256 26 Feb 20:39 ..
> drwxr-xr-x 10 root wheel 320 26 Feb 20:39 A
> lrwxr-xr-x 1 root wheel 1 22 Feb 14:06 Current -> A
>
>
> Do you know where the installation is supposed to end up?
Can you `find /System/Library/Frameworks/JavaVM.framework/Versions/`? Current -> A, and A is real... I think you have a version in there.
In any case, you'll see that mobile/android bootstrap on macOS now wants you to put:
ac_add_options --with-java-bin-path="/Library/Java/Home/bin"
in your mozconfig.
| Reporter | ||
Comment 7•8 years ago
|
||
(In reply to Nick Alexander :nalexander from comment #6)
> Can you `find /System/Library/Frameworks/JavaVM.framework/Versions/`?
> Current -> A, and A is real... I think you have a version in there.
The one there is version 9 (i.e. the one that gets run when I just run `java`).
> In any case, you'll see that mobile/android bootstrap on macOS now wants you
> to put:
>
> ac_add_options --with-java-bin-path="/Library/Java/Home/bin"
>
> in your mozconfig.
Ah, this answers my question, java 8 is in /Library/Java/Home, which is a symlink to /Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home
So this command works (or at least gets past the error I was seeing before):
$ JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home ./mach bootstrap
Updated•7 years ago
|
Keywords: good-first-bug
Version: Version 3 → 3 Branch
Updated•7 years ago
|
Keywords: good-first-bug
Comment 9•5 years ago
|
||
Since we're asserting that Java 8 is used for the full build at the moment, this issue is most likely "fixed" as fallout of that.
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•