UnsupportedClassVersionError: - exception

I am a Beginner and When I was creating a Spring starter project in Spring tools Suite4,while running the project.I got this Exception.."UnsupportedClassVersionError:"
I am using Java version,[Console[Build PAth[POM filePOM file](https://i.stack.imgur.com/ubh9M.png)](https://i.stack.imgur.com/2nLgs.png)](https://i.stack.imgur.com/QA10Y.png)
java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
I have attached pics of console,pom and build path
I tried to import it to Ecliipse..But it was showing me the Same Exception

Related

Scaffolding a MySQL view using Pomelo and .Net Core 2.1

Apparently, with .Net Core 2.1, views are now supported. I was wondering if it is possible to scaffold a view using Pomelo, and if so, what the syntax is? I tried the "table" syntax with a view but it didnt work:
dotnet ef dbcontext scaffold "Server=myserver.com;Database=myDatabase;User=userame;Password=password;" "Pomelo.EntityFrameworkCore.MySql" -t personsView -o models
It runs, but it only generates a dbContext - it doesn't generate the model.
I'm using Pomelo 2.1.1 and Visual Studio 2017 (15.7.5). My project is a .Net Core 2.1 Web API. On the back end, I have MySQL Server 5.6.30.
Using Pomelo, you can use the following command (within the Package Manager Console) to generate the models as well as the context class:
Scaffold-DbContext [CONNECTION_STRING] Pomelo.EntityFrameworkCore.MySql -OutputDir [OUTPUT DIRECTORY] -Context [NAME OF CONTEXT CLASS] -f

Reference .netstandard 2.0 project in core 2.0 Runtime loading error when GenerateAssemblyInfo = false

When we add the reference, we are able to use the .netstandard libs classes in our .net core console project (in Visual Studio), and it compiles.
When we run the app, it immediately crashes with this error in the output window:
An unhandled exception of type 'System.IO.FileNotFoundException'
occurred in Unknown Module. Could not load file or assembly
'MyNetStandard20Assembly, Version=0.1.0.0, Culture=en-us,
PublicKeyToken=null'. The system cannot find the file specified.
Update / Cause (still looking for reason)
So we use AssemblyInfo files in our projects and in order to make these work with the new project structure we needed to add this to the first PropertyGroup in the .NET Standard project:
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
That then allows us to have a Properties/AssemblyInfo.cs file in the project, just like a .NET Framework project would allow.
Anyway, when we remove this from the .NET Standard project then the .NET Core project finds the assembly and is happy.
Does anyone know why?

Google-maps-services-java firebase

I have a working Java Firebase Admin SDK application. The moment I add google-maps-services to gradle I get this exception:
Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;)V
at com.google.firebase.FirebaseApp.checkNotDeleted(FirebaseApp.java:317)
at com.google.firebase.FirebaseApp.getOptions(FirebaseApp.java:263)
at com.google.firebase.database.FirebaseDatabase.getInstance(FirebaseDatabase.java:75)
The two lines I added to build.gradle are:
compile group: 'com.google.maps', name: 'google-maps-services', version: '0.2.3'
compile 'org.slf4j:slf4j-nop:1.7.25'
Question: What am I doing wrong trying to use google-maps-services in a Java Firebase Admin SDK application?
I filed an issue here: https://github.com/googlemaps/google-maps-services-java/issues/355
Looks like this will be addressed in a new release.

JavaFx 2.0 + EJB + Netbeans - Runtime Exception

please,
I wrote a test app in JavaFx 2.0 + EJB in the Netbeans IDE and I got a problem running this app outside netbeans.
I have a form using FXML and an action of this form runs a EJB method. I am using the Glassfish Server.
When I run this test app on netbeans it works perfectly, but when I run the app outside of Netbeans like jnlp or in the browser ... the app can't access the EJB methods. I couldn't see the error message in webstart or in the browser. So, I ask:
1) How can I see the error message in a web start or in the browser? (like javaws test-app.jnlp)
2) I guess the error occurs because of classpath issues. (I need gf-client.jar and javaee-api-6.0.jar in the classpath in order the app works). How can I assure these jars are in the classpath?
Sorry by my english.
Thanks,
Cleber.
to see errors from jnlp you need to enable Java Console:
Control Panel - Java Properties - Advanced - Java Console - Enable Console
for jnlp case all external libs should be stated in jnlp file. Usually NetBeans do it for you, but you can debug this case by reviewing Java Console output.

Jruby log4j integration

I am currently working on integrating Java application General Architecture For Text Engineering (GATE) with a Rails application using JRuby architecture. When we worked on integrating JRuby with log4j, I am getting following error:
0 [main] DEBUG Main.class - Hello world
gate/Gate.java:80:in `<clinit>': java.lang.NoClassDefFoundError: org/apache/log4
j/Logger (NativeException)
from gateapp/Main.java:86:in `main'
from test.rb:12
test.rb is the name of ruby program.
I tried importing all the log4j apache libraries, and included the class file in the test.rb file.
When I run the Java program alone its running fine. But when I generate the jar file and include them in Ruby file (test.rb) , I am getting this error
java.lang.NoClassDefFoundError: org/apache/log4j/Logger (NativeException) problem is occuring. How to deal with this problem ?
You need to make sure the log4j JAR file is in your classpath. One way to do this is to set the CLASSPATH variable in your environment. Another way would be to call require in your ruby code like
require "/some/path/MyStuff.jar"
Here is my config to set it up with couchbase Java SDK
include Java
def setup_log4j
java::lang.System.setProperty("net.spy.log.LoggerImpl", "net.spy.memcached.compat.log.Log4JLogger")
fa = Java::OrgApacheLog4j::FileAppender.new();
fa.setName("FileLogger");
fa.setFile("./log/#{Rails.env}.log");
fa.setLayout(Java::OrgApacheLog4j::PatternLayout.new("%d %-5p [%c{1}] %m%n"));
fa.setThreshold(Java::OrgApacheLog4j::Level::INFO);
fa.setAppend(true);
fa.activateOptions();
Java::OrgApacheLog4j::Logger.getRootLogger().addAppender(fa)
end
Just beware that I required the lo4j.jar file earlier.
Worth to mention that there is project named log4jruby.