How to fix error Unsupported major.minor version 52.0 when syncing Gradle Script Android Studio

Hi folks,

Recently when trying to run an Android project in Android studio, I noticed the following error on opening it:

Unsupported major.minor version 52.0

After doing some Google search I found that the problem was due to the code requiring Java 8 while my IDE used Java 7. So, to fix it one has to

– Go to File > Other Settings > Default Project Structure…

– If your JDK location is set to a Java 1.7 location, change it to the corresponding Java 1.8 location. In my case the required path was

/Library/Java/JavaVirtualMahines/jdk1.8.0_66.jdk/Contents/Home

– Click OK

That’s it. Now the error should go away.

How to Create VirtualHost in Tomcat 8

Hi folks,

Today I will discuss how to create a VirtualHost on Tomcat 8. For those who don’t know, Tomcat is a very popular open-source web server for hosting Java web applicationsm. Tomcat implements a bunch of Java EE specifications like Java Servlet, JavaServer Pages (JSP), Websocket and Java EL [1].

Let’s assume you installed Tomcat 8 in /usr/local/apache-tomcat-8.0.30. you want to add a virtual host sweetapp.com. Assume the project folder is at /usr/local/apache-tomcat-8.0.30/webapps/myapp

Open the file /usr/local/apache-tomcat-8.0.30/conf/server.xml
Then add the following lines:

 <Host name="sweetapp.com" appBase="webapps" unpackWARs="true" autoDeploy="true">
 <Alias>www.mydomain.org</Alias>
 
 <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
 prefix="sweetapp_access_log" suffix=".txt"
 pattern="%h %l %u %t "%r" %s %b" />
 
 <Context path="" docBase="/usr/local/apache-tomcat-8.0.30/webapps/myapp"
 debug="0" reloadable="true"/>
</Host>

Save and close the file.

Then restart tomcat using the commands:

   /usr/local/apache-tomcat-8.0.30/bin/shutdown.sh
   /usr/local/apache-tomcat-8.0.30/bin/startup.sh 

Sources

Apache Tomcat – Wikipedia, the free encyclopedia. https://en.wikipedia.org/wiki/Apache_Tomcat