I got an extremely annyoing error in Eclipse (in the console):
Invalid layout of java.lang.String at value
A fatal error has been detected by the Java Runtime Environment:
Internal Error (javaClasses.cpp:129), pid=15238, tid=140306591237888
fatal error: Invalid layout of preloaded class
JRE version: 7.0_07-b10
Java VM: Java HotSpot(TM) 64-Bit Server VM (23.3-b01 mixed mode linux-amd64 compressed ops)
Failed to write core dump. Core dumps have been disabled. To enable core dumping, try ulimit -c unlimited" before starting Java again
An error report file with more information is saved as:
/home/till/workspace/Encrypt/hs_err_pid15238.log
If you would like to submit a bug report, please visit:
http://bugreport.sun.com/bugreport/crash.jsp
Log Download
I cant't make any sense of this, because even Eclipse doesn't display any errors (in the code editor)...
This is a real productivity-killer, because it blocks all progress.
If anyone has any ideas on how to solve this, please answer this question.
Thank you really much in advance,
Till
In case of an Android project, you have to remove Android Lib from the launch configuration for that specific class. Use the "walkthrough" below as a guide.
Project->Properties->Run/Debug Settings;
Select your Class and click "Edit";
Open the tab "Classpath" and remove Android Lib from "Bootstrap Entries";
Apply everything and Run the class again.
I had same problem,then(as Jeff Schultz said here) I tried:
Run As -> Android Application
and problem solved.But I don't know the reason that causes this problem.I hope this help you!
This happened to me after:
Inserting a class in the Android Application project where I had forgotten to remove public static void main(String args[]) function. (Had previously performed a quick test of the class).
Tried to run the Application while I had opened and focused the above class on Eclipse editor.
The funny thing was that, after the Eclipse error, no matter on what class I switched the focus on, when I was trying to run the application again, I was stuck with the same error.
Inspired by Odyr Sohn solution, I managed to solve the problem (from Project->Properties->Run/Debug Settings deleting the faulty Launch configuration), but as soon as I was trying to run the application from this class, the same thing was happening again. When I removed public static void main(String args[]) function from the class, the problem was solved for good.
You should make a run configuration for an "Android application". If you make it for "Java Application" by mistake this error will show.
Same thing happened to me. I created a TestActivity and I guess it had a public static void main(String args[]) function. I went into the properties and then the Run/Debug and deleted TestActivity and it worked just fine.
I had the same problem, solved it by:
Run->Run Configurations;
Click on left on "Android Application"-> Button on top "New";
then type in a name and "Browse" the Project -> works!
I had a similar problem on the fatal error: Invalid layout of preloaded class with Kepler Service Release 1 using windows 7.
Project -> Properties -> Java Build Path -> Order and Export --> check mark any
unchecked library or Android version and then hit OK. Then run as Android application.
Related
so i am just trying eclipse with processing and are having a problem with getting the java application to run.
I am basically following this tutorial: https://processing.org/tutorials/eclipse/
I have followed the steps but when i get to this part:
import processing.core.PApplet;
public class UsingProcessing extends PApplet{
public static void main(String[] args) {
PApplet.main("UsingProcessing");
}
}
No errors or nothing but when i press run (run as java application), a java program opens (no window, i can just see the program in the bottom part of the screen). Then it closes after a couple of seconds.
I also get the following errors:
java.lang.NoClassDefFoundError: com/apple/eawt/QuitHandler
at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3119)
at java.base/java.lang.Class.getMethodsRecursive(Class.java:3260)
at java.base/java.lang.Class.getMethod0(Class.java:3246)
at java.base/java.lang.Class.getMethod(Class.java:2065)
at processing.core.PApplet.runSketch(PApplet.java:10707)
at processing.core.PApplet.main(PApplet.java:10504)
at processing.core.PApplet.main(PApplet.java:10486)
at UsingProcessing.main(UsingProcessing.java:6)
Caused by: java.lang.ClassNotFoundException: com.apple.eawt.QuitHandler
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
... 9 more
That part of code should at least give me an empty sketch but i get nothing..
This guy got it to work but i cant.. https://www.youtube.com/watch?v=0cqSjyvA8EY
I can assure you that i have imported the processing library correct, so that is not where the problem lays. I believe that it is some problem with my java? I am using a macbook pro and the following java:
Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)
Thankful for all the help and I am kind of new to this so please be gentle if anything is wrong!
EDIT:
I have also tried with IntelliJ without luck, the same thing, java opens for a brief moment and then closes. This video was my guide: https://www.youtube.com/watch?v=_h2GZgnPcnM
I can assure you that i have imported the processing library correct, so that is not where the problem lays.
You need more than just the core.jar library. In your case you need whatever .jar file contains the com/apple/eawt/QuitHandler class.
This answer says that the .jar you're looking for comes with the Mac JDK. Try adding that .jar file to your classpath.
So i believe the problem is sort of solved. The problem was (i think) with the java that apple uses(?). So i downgraded to the Processing 2 core.jar and everything worked fine.
Found here: https://github.com/processing/processing/issues/5371
and a link that i did not fully understand : https://github.com/processing/processing/wiki/Supported-Platforms#java-9
The guy there suggests that you should downgrade your jdk(?), but I think that it was processing 2 that was discussed (when i did that it did not work). So for now, everything in eclipse done with processing has to be done with processing 2.
This is strange because the tutorial on processings website made it work with processing 3
EDIT: the previous answer was asked more than five years ago..
There was error occurred in Line 14.
Exception in thread "main" java.lang.RuntimeException: Uncompilable
source code - Erroneous sym type:
Hard to find solution.
package example;
public class Num
{
public static void main(String [] args)
{
String s = "42";
try
{
s = s.concat(".5");
double d = Double.parseDouble(s);
s = Double.toString(d);
int x = (int) Math.ceil(Double.valueOf(s).doubleValue()); //Line 14
System.out.println(x);
}
catch (NumberFormatException e)
{
System.out.println("Wrong Number");
}
}
}
The code you provided runs fine on my computer.
I'm guessing you are using Netbeans and may be affected by a bug.
Try this:
Open the project properties, select the Build-Compiling, uncheck "Compile on save" and rerun the application. This will make sure all your source code becomes recompiled before running it.
Link: https://forums.netbeans.org/topic43241.html
This is a common issue which I get while working. What I do is clean and build the project. It solves the problem.
Right Click on the project name >> Clean and build
Download/install JDK major version number the same as NetBeans.
i.e. If You have NetBeans 9 version, but your JDK is version 10,then try use NetBeans 10 version... or download/install JDK 9 (the same as NetBeans).
Create new java platform for new jdk installation.
Open netbeans menubar->tools->Java Platforms->Add Platform
Specify the folder that contains the Java platform as well as the sources and Javadoc needed for debugging.
Set new java platform to your project
Right click on project ->properties->Libraries->Java Platform->select the jdk version that same as NetBeans
Select source format of your project
Right click on project ->properties->Sources->Sources/binary format->select the jdk version that same as NetBeans.
If it still gives errors like,
Exception in thread "main" java.lang.RuntimeException:
at javaapplication2.JavaApplication2.main(JavaApplication2.java:1)
C:\Users\James\AppData\Local\NetBeans\Cache\dev\executor-snippets\run.xml:111: The following error occurred while executing this line:
C:\Users\James\AppData\Local\NetBeans\Cache\dev\executor-snippets\run.xml:68: Java returned: 1
BUILD FAILED (total time: 1 second)
do as "sinclair" has mentioned above.
Open the project properties, select the Build-Compiling, uncheck "Compile on save" and rerun the application. This will make sure all your source code becomes recompiled before running it.
I received this error after I'd changed the type of a function parameter and it was the calling page that was in error - but I didn't see this until a magical Clean and Build pointed me to the actual issue!
I got this error message because I copied and pasted code without including the package name. I added the package name and it was fixed.
in my case
i have solved using import with package name and class name
like this import package.class1;
Please uncheck "Compile on save"
I have create java application using sikuli-script(latest version 1.0.1).
I added the sikuli-script.jar to the Referenced Libraries (I configured using this answer Answer Link)
java code folder structure -->
Java code -->
package com.example.sikuli;
import org.sikuli.script.*;
import java.util.concurrent.TimeUnit;
public class TestSikuli {
public static void main(String[] args) {
Screen s = new Screen();
App app = new App("C:/Program Files/Mozilla Firefox/firefox.exe");//firefox path
try{
app.focus();
TimeUnit.SECONDS.sleep(2);
s.click("imgs/1391152193781.png", 0);//url bar image
s.type(null, "http://www.google.lk", 0);
s.click("imgs/1391152289812.png", 0);//click search image
}
catch(FindFailed e){
e.printStackTrace();
}
}
}
After that i set the the Run Configutrtion such as PATH and SIKULI_HOME
Next I run the code it's working properly.
Then I create .exe using launch4j and according to this site instructions --> How to Create an Executable File from Eclipse
After that i run the .exe file from command prompt then following errors occurred. Please help me.
Error -->
[error] ResourceLoaderBasic: check: libs dir is empty, has wrong content or is outdated
[action] ResourceLoaderBasic: check: Please wait! Trying to extract libs to: C:\Documents and Settings\Dell\SikuliX\libs
[error] ResourceLoaderBasic: loadLib: Fatal Error 109: not found: C:\Documents and Settings\Dell\SikuliX\libs\VisionProxy.dll
[error] Terminating SikuliX after a fatal error(109)! Sorry, but it makes no sense to continue!
If you do not have any idea about the error cause or solution, run againwith a Debug level of 3. You might paste the output to the Q&A board.
--1. when programming in Java using Sikuli, you should always use sikuli-java.jar (sikuli-ide.jar contains much stuff not needed here).
--2. Set a JVM option -Dsikuli.Debug=3 when running the exe to get more details about what's going on. I guess the problem is, that for some reason the export of the native libs does not work in the context of a launch4J exe (I did not test this yet).
--3. always use the latest version (1.1.1 in this case, still nightly but pre-final ;-) http://sikulix.com
When I try to debug any project in Java EE INDIGO (64 bit) in win 7 and place a breakpoint somewhere the program acts as expected but when I hit f6 or f5 to go further eclipse throws an error which reads (I have Spring installed):
An internal error occurred during: "JDI Event Dispatch".
com.springsource.sts.groovy.debug.core.GroovyDebugProvider.isAlwaysInteretingLaunch()Z
(No typo, "Z" does appear)
Now I can't debug any program because it always gives this error. Can anyone help?
From the eclipse error log:
!MESSAGE com.springsource.sts.groovy.debug.core.GroovyDebugProvider.isAlwaysInteretingLaunch()Z
!STACK 0
java.lang.AbstractMethodError: com.springsource.sts.groovy.debug.core.GroovyDebugProvider.isAlwaysInteretingLaunch()Z
at org.eclipse.contribution.jdt.debug.DebugHooksAspect.isInterestingLaunch(DebugHooksAspect.aj:253)
at org.eclipse.contribution.jdt.debug.DebugHooksAspect.ajc$inlineAccessMethod$org_eclipse_contribution_jdt_debug_DebugHooksAspect$org_eclipse_contribution_jdt_debug_DebugHooksAspect$isInterestingLaunch(DebugHooksAspect.aj:1)
at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.getStepFilters_aroundBody1$advice(JDIDebugTarget.java:195)
at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.getStepFilters(JDIDebugTarget.java:1)
at org.eclipse.jdt.internal.debug.core.model.JDIThread$StepHandler.attachFiltersToStepRequest(JDIThread.java:2154)
at org.eclipse.jdt.internal.debug.core.model.JDIThread$StepHandler.createStepRequest(JDIThread.java:2065)
at org.eclipse.jdt.internal.debug.core.model.JDIThread$StepHandler.createStepRequest(JDIThread.java:2040)
at org.eclipse.jdt.internal.debug.core.model.JDIThread$StepHandler.step(JDIThread.java:1989)
at org.eclipse.jdt.internal.debug.core.model.JDIThread.stepOver(JDIThread.java:1412)
at org.eclipse.jdt.internal.debug.core.model.JDIStackFrame.stepOver(JDIStackFrame.java:418)
at org.eclipse.debug.internal.core.commands.StepOverCommand.step(StepOverCommand.java:27)
at org.eclipse.debug.internal.core.commands.StepCommand.doExecute(StepCommand.java:34)
at org.eclipse.debug.core.commands.AbstractDebugCommand$1.run(AbstractDebugCommand.java:213)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
This seems to be a similar bug to this bug in codehaus jira (see comments section). I was able to switch back to an older eclipse installation (from two weeks ago) to get rid of the current problem and will upgrade to Eclipse 3.7 as soon as time permits.
As crazy as this sounds, I too was getting this error when debugging an Android App and trying to step into a specific method, and resolved it by renaming the method I was trying to step into.
I had tried:
completely reinstalling the app
cleaning in Eclipse
reboot of device (phone), OS, and restart of Eclipse
increasing debug timeouts in Preferences | Java | Debug
My method was called "getMessageInfoFromDb"... and was in a class that didn't extend anything, but implemented Serializable ;-)
Try disabling simple step filtering, especially filtering of simple getters.
delete the Temp folder from yourlocalpath\domainfolder\server\AdminServer
domains\base_domain\servers\AdminServer
Have you done any DB import twice or more time on the same DB that you use for the application in which you are running in debug mode. Because I am also getting similar error with the caption JDI while starting Application Server with deployed .ear in Eclipse based IDE as a popup.
When db is imported twice user created tables gets imported if it's been tried in the same kind of databases. But Oracle App & System Specific tables throws error in process of importing. And some crash in that....
I hope this is what scenario yours as well....
In my scenario I had imported Oracle db from UNIX environment to Oracle XE in Windows environment.
I have a project in IntelliJ IDEA I want to run locally. When I click its debug button it says:
ERROR: Cannot load this JVM TI agent twice, check your java command line for duplicate jdwp options.
Disconnected from server
Error occurred during initialization of VM
agent library failed to init: jdwp
When I click the run button it works. What is the matter?
This is probably too late to help you, but maybe it will help somebody else. The answer is based on a support forum posting by Aleksei Sosnovski.
This can happen when your JAVA_OPTS contains two -Xrunjdwp arguments. E.g., one of these arguments might come from the server start script invoked by IntelliJ to start the container, and another may be added by IntelliJ itself. You can check by looking at JAVA_OPTS in the log when launching the container without debug. If you see an -Xrunjdwp argument, just find where it is set in the container startup script, and remove it.
I guess you already are debugging the server app? In this case it's not possible to connect another instance of debugger.
Most likely the problem happens because you have specified the debugging options in the "VM parameters" field of your run configuration. Everything will work if you remove them.
I had the same problem in my case -Xrunjdwp was set twice: one in the IDEA debug configuration and again in the system variables in CATAALINA_OPTS.
once I removed it from system variables (inside the IDEA it is read only) problem was fixed
Thanks for the tips, it helped me work out the problem too. Mine was due to having
set DEBUG_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
In my catalina.bat
check server.xml if you have jvmEntries get rid of that entry from server.xml
<!-- <jvmEntries xmi:id="JavaVirtualMachine_1" classpath="" bootClasspath="" verboseModeClass="false" verboseModeGarbageCollection="false" verboseModeJNI="false" runHProf="false" hprofArguments="" debugMode="false" debugArgs="-Djava.compiler=NONE -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7777" genericJvmArguments="">
Open admin console (http://localhost:9060/ibm/console/login.do)
Application servers > server1 > Debugging service
un-check Enable service at server startup if checked restart server.
On Intellij uncheck the 'Pass environment variables' box in Run/Debug configuration