I'm trying to install Android SDK (not Studio) following this tutorial - https://linoxide.com/linux-how-to/install-android-sdk-manager-ubuntu/
When running sdkmanager --list I was getting the following error:
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)
So amended the file ~/android-sdk-tools/bin/sdkmanager and amended the following line to be:
DEFAULT_JVM_OPTS='"-Dcom.android.sdklib.toolsdir=$APP_HOME" -XX:+IgnoreUnre cognizedVMOptions --add-modules java.se.ee'
Now the error doesn't show, but when I run sdkmanager --list it just hangs without any response.
If it helps, here's my versions of java etc:
$ java -version
openjdk version "10.0.2" 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.2)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.2, mixed mode)
$ javac -version
javac 10.0.2
Java version 9 and 10 are not supported for android sdk, downgrade your java version 8 or less.
Related
I am running java 8 on my Mac, but when I try to create a new project it gives me this error saying it cannot enable Maven. I never had this problem on windows.
The Apache NetBeans 13 binary releases require JDK 11+, and officially
support running on JDK 11 and JDK 17.
Source: https://netbeans.apache.org/download/nb13/nb13.html
Therefore try to upgrade your JDK.
I'm trying to run the the cordova build Android command and it's failing. Error message output:
$> cordova build android
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=C:\Android (recommended setting)
ANDROID_HOME=C:\Android (DEPRECATED)
Cannot read property 'version' of null
I have the latest version of cordova, gradle and the Java 8 JDK installed. And all the environments are set. I have no idea what could be the issue.
$ gradle -v
------------------------------------------------------------
Gradle 7.1.1
------------------------------------------------------------
Build time: 2021-07-02 12:16:43 UTC
Revision: 774525a055494e0ece39f522ac7ad17498ce032c
Kotlin: 1.4.31
Groovy: 3.0.7
Ant: Apache Ant(TM) version 1.10.9 compiled on September 27 2020
JVM: 1.8.0_301 (Oracle Corporation 25.301-b09)
OS: Windows 10 10.0 amd64
$ cordova --version
10.0.0
$ java -version
java version "1.8.0_301"
Java(TM) SE Runtime Environment (build 1.8.0_301-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.301-b09, mixed mode)
Removing and re-adding the platform resolved my issue.
cordova platform rm android
cordova platform add android
I am trying compile AOSP code using schroot in ubuntu 18.04 64 bit.
Not able to find java in schroot.
$java -version
bash: java: command not found
If I open another terminal and enter java version command its working. like below
java -version
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
Do you have the jdkX repo synced in? AOSP provides the prebuilts, for android 10, it is jdk9. For example, if I run the following command I get openjdk9:
. build/envsetup.sh && lunch aosp_blueline-userdebug
which java && java --version
Output:
prebuilts/jdk/jdk9/linux-x86/bin/java
openjdk 9
OpenJDK Runtime Environment (build 9+181-android4685155)
OpenJDK 64-Bit Server VM (build 9+181-android4685155, mixed mode)
Try running your java commands after lunch.
i am trying to play with apache-flink, with the set of examples and i am trying to compile them from scratch using GitHub code in order to run them using the flink install from brew command.
It's funny but the brew installation does not include any of the examples, so I am forced to install them from the sources in GitHub.
The problem is i cannot compile the examples because of some errors. I understand that this compiling error can happen, i only need one stable branch to run the projects as described in the official link.
I am using this settings:
java -version
java version "1.8.0_172"
Java(TM) SE Runtime Environment (build 1.8.0_172-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.172-b11, mixed mode)
mvn -version
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T21:39:06+02:00)
Maven home: /usr/local/Cellar/maven/3.5.0/libexec
Java version: 10.0.1, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home
Default locale: es_ES, platform encoding: UTF-8
OS name: "mac os x", version: "10.13.4", arch: "x86_64", family: "mac"
This is the link of release-1.5 compile.
This is the link of release-1.3 compile.
This is the link of master compile.
Which release is stable?
EDIT
After #FabianHueske advice, i downgraded the maven version:
flink aironman$ mvn -version
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T18:29:23+01:00)
Maven home: /usr/local/Cellar/maven#3.2/3.2.5/libexec
Java version: 10.0.1, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home
Default locale: es_ES, platform encoding: UTF-8
OS name: "mac os x", version: "10.13.4", arch: "x86_64", family: "mac"
MacBook-Pro-Retina-de-Alonso:flink aironman$ jenv versions
system
1.7
1.7.0.51
1.8
1.8.0.172
10.0
10.0.1
oracle64-1.7.0.51
* oracle64-1.8.0.172 (set by /Users/aironman/.jenv/version)
oracle64-10.0.1
MacBook-Pro-Retina-de-Alonso:flink aironman$ java -version
java version "1.8.0_172"
Java(TM) SE Runtime Environment (build 1.8.0_172-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.172-b11, mixed mode)
This is the output of the compiling of the tag release-1.5.0.
I realize that maven is trying to use version 10.0.1 of the jdk, although the command java -version says I'm using version 1.8, it might be a problem with my maven and jdk configuration?
You can only compile Flink with java 8, according to the exceptions during the build you're using java 9+.
solr-5.4.0 version
My Java version
java -version
java version "1.7.0_91"
OpenJDK Runtime Environment (IcedTea 2.6.3) (7u91-2.6.3-0ubuntu0.14.04.1)
OpenJDK 64-Bit Server VM (build 24.91-b01, mixed mode)
I did all steps finally am getting this error
sudo service solr status
Found 1 Solr nodes:
Solr process 6003 from /var/solr/solr-8983.pid not found.
How to fix this error?
That Digital Ocean tutorial recommends Java 8 with Solr 5 and provides installation instructions using a PPA. I also found another SO question where switching to Java 8 was the resolution.
I created a fresh Ubuntu 14.04 VM using Vagrant and VirtualBox with these commands...
vagrant init ubuntu/trusty64
vagrant up
Then I followed the tutorial with Solr 5.4.0, and got the same error you did. However, my Solr logs were not deleted, so I was able to find this...
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 402653184 bytes for committing reserved memory.
My Vagrant VM had 512 MB of RAM so I doubled that to 1 GB which is recommended in the tutorial, did a vagrant reload, and Solr started working. Here is my minimal Vagrantfile...
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.provider "virtualbox" do |vb|
vb.memory = "1024"
end
end
I'm using VirtualBox 5.0.10 and Vagrant 1.8.1. I hope this works for you.
UPDATE: I just went through the tutorial again with a 32-bit Ubuntu 14.04 VM (ubuntu/trusty32 in Vagrantfile) and that also worked. So if you're on a 32-bit host or the 64-bit VM doesn't work for you, the 32-bit VM should work.
I will throw my answer in here just in case someone else spends another hour like I did.
Solr version 6.1.0 + Java 1.7 same error.
I had to upgrade to 1.8. How did I know that was the problem?
:/var/solr/logs# cat solr-8983-console.log
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/eclipse/jetty/start/Main : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:803)
at ....
The 52 version means you need Java 1.8.
Upgrade Ubuntu using
$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installer
Credit to this comment.