Questions tagged [java.lang.class]

Java.lang.class is a runtime representation of classes and interfaces.

97 questions
0
votes
0 answers

While attempting to set up a raspberry pi minecraft server, im getting an error message that states my Java Runtime version is too high

It reads: "Error: LinkageError occurred while loading main class net.minecraft.bundler.Main java.lang.UnsupportedClassVersionError: net/minecraft/bundler/Main has been compiled by a more recent version of the Java Runtime (class file version 61.0),…
0
votes
0 answers

error occurs when an Activity is unable to start due to an InflateException

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.myapp/com.example.myapp.MainActivity}: android.view.InflateException: Binary XML file line #17: Binary XML file line #17: Error inflating class…
CoreGyan
  • 1
  • 4
0
votes
1 answer

"System" could not be resolved even though imports are correct

When I compile my JSP page, it does not seem to work since it doesn't resolve the System class. I need to get the time in milliseconds so I can input it in the DB org.apache.jasper.JasperException: Unable to compile class for JSP: An error…
0
votes
0 answers

JMX java.lang:,type=GarbageCollector interpretation

Have set up collection of java GC data points into an elastic cluster from jolokia/JMX of a Jboss server, but attempting to browse descriptions in the jolokia's jmx console doesn't tell much on how to interpret the data collected like what are unit…
0
votes
1 answer

Java error: java.lang.NoClassDefFoundError with Maven on VSCODE

Hello i'm currently learning java i'm taking a course and we're diving into Maven proyects. The thing is that i'm getting an error when i tried to run a simple "Hello World" and my teacher couldn't find a solution This is the code package bmt; /** …
0
votes
0 answers

JavaFX java.lang.reflect.InvocationTargetException issue PROJECT SETUP ISSUE

Hello I am new in JavaFx, I'm trying to build a login/signup application, I think my code is correct and my big issue is a NULL statement or a project setup that I can't see to fix. I tried to follow most of the answers in similar questions but I…
0
votes
1 answer

Cannot instantiate interface

When I tried to run my project(no build errors)there was an exception: Exception in thread "main" java.lang.IllegalArgumentException: Cannot instantiate interface org.springframework.context.ApplicationListener :…
0
votes
1 answer

Class.forName + ExceptionInInitializerError + static initialization + weird Array init

I recently "inherited" a project and tried to get an instance of a service running locally. I encountered - and fixed - some problems with code similar to... class A { // ... public void doSomething() { // ... Class foo =…
0
votes
0 answers

How does Class Class actually represent other Classes and interfaces in java?

I've been trying to understand that how the Class Class actually works in java but everywhere I look all it says is that its references represent the Classes and Interfaces in a running java application but nowhere I've managed to find that how…
ansme
  • 413
  • 2
  • 11
0
votes
0 answers

Mocking java.lang.Class getDeclaredMethod(String name, ...Class args) with Mockito not working

I am trying to mock the getDeclaredMethod on a java .class object of a certain defined java type: AccessRulesMethods accessRulesMock = mock(AccessRulesMethods.class); Method mockMethod =…
0
votes
0 answers

Not sure why code returning an Illegal exception related with input data on java 8

I have written the code below. I made a database, with type "Integer" to accept number values, string to accept "Letter" values and "Date" to accept Date values. Once i run it, i get the above captioned error on the JOptionPane dialog box, and after…
0
votes
1 answer

Unable to execute a java code in eclipse ide

Sample Code: package pack.java; import java.util.*; public class Bye { public static void main(String args[]) { int a=3,b=5; System.out.println("The sum is:"+(a+b)); } } I am unable to execute any code in the eclipse ide. I am…
0
votes
0 answers

How to dump or write modified java.lang.Class using reflection to file?

I'm trying to update the method annotation value in a java file at runtime. I'm able to update the value and finally, I got the changes. But don't know how to write the updated source code to file. I'm assuming all changes are present in forName. So…
kumar
  • 11
  • 1
0
votes
0 answers

java.lang.ClassNotFoundException while executing DB connection statements

I have set of DB connection statements in my java file which takes the driver name, url, username and password from my property file and then try to make a connection. But I am keep getting error exactly in this try block . My code is try { …
0
votes
0 answers

Netbeans IDE runtime exception

Good day, I am self-taught with the help of a few free online courses in Java and very new to everything. I'm struggling to run a code that's meant to send emails with a set content using my PC as localhost. using Netbeans IDE, I keep getting the…