I installed LibGDX and IntelliJ15.
Then I built my LibGDX App and followed the instructions in this guide :
https://github.com/libgdx/libgdx/wiki/Gradle-and-Intellij-IDEA
I imported the programm with gradle into IntelliJ.
Whenever I try to start the DesktopLauncher, I get the following errors: Exception in thread "main" java.lang.ClassNotFoundException: com.hit.game.desktop.DesktopLauncher
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:122)
I also tried to shorten the DesktopLauncher to:
System.out.println("asdfasdasd");
//LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
//new LwjglApplication(new HitGame(), config);
But I still get those errors :/
Does anybody have an idea or a hint what I am doing wrong ?
Wow,
after spending now more like 2 hours on this problem, it is a specific BUG in intellij 15.0.x ...
https://youtrack.jetbrains.com/issueMobile/IDEA-147788
One way to "build" properly is described in a Reddit post of User anubiann00b :
1. Run gradlew cleanIdea and gradlew idea, specifically in the InteilliJ terminal.
2. A popup comes up asking you to reload the project. Hit accept.
3. Ignore the message to import an unlinked gradle project.
4. Error message on make tells you there isn't an Android SDK. Go to the android module and change the SDK from Java to Android.
https://www.reddit.com/r/libgdx/comments/3tgjqi/using_libgdx_with_intellij_idea_desktop_module/
I've solved it by clicking on the desktop project then run>edit configurations>click on +>gradle>set Gradle project to Project:desktop and type run in tasks and apply and run
Related
I'm trying to access dynamoDB from my Lambda function.
The function has the correct IAM role, and was created using the AWS plugin for Eclipse.
When the code gets to this line:
dynamoDB = new DynamoDB(new AmazonDynamoDBClient(
new EnvironmentVariableCredentialsProvider()));
I get the following runtime exception:
Input: com.xr4p.Request#13a57a3borg/apache/commons/logging/LogFactory: java.lang.NoClassDefFoundError
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at com.amazonaws.AmazonWebServiceClient.<clinit>(AmazonWebServiceClient.java:56)
at com.xr4p.Dana.handleRequest(Dana.java:30)
at com.xr4p.Dana.handleRequest(Dana.java:1)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 3 more
I have tried to create the function from scratch,the project from scratch and nothing... The same error keeps popping whenever these lines are added.
What am I missing here?
Thanks
The problem was in Eclipse's project configuration:
Once the "AWS SDK for Java" was added to the "java build path" -> "libraries" it worked ok.
I recently updated my system from Mavericks (OSX) to Yosemite. I use to be able to right click on a test and run it. Now I get the exception
/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/bin/java -ea -Didea.launcher.port=7541 "-Didea.launcher.bin.path=/Applications/Android Studio.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath "/Applications/Android Studio.app/Contents/lib/idea_rt.jar:/Applications/Android Studio.app/Contents/plugins/junit/lib/junit-rt.jar:/Users/michael.cameron/Code/Android/sdk/platforms/android-21/android.jar:/Users/michael.cameron/Code/Android/sdk/platforms/android-21/data/res:/Users/michael.cameron/Code/Android/darxstudios/TheChefsCodex/app/build/intermediates/classes/debug:/Users/michael.cameron/Code/Android/darxstudios/TheChefsCodex/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.3/classes.jar:/Users/michael.cameron/Code/Android/darxstudios/TheChefsCodex/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.3/res:/Users/michael.cameron/Code/Android/darxstudios/TheChefsCodex/app/libs/ParseCrashReporting-1.8.0.jar:/Users/michael.cameron/Code/Android/sdk/extras/android/m2repository/com/android/support/support-annotations/21.0.3/support-annotations-21.0.3.jar:/Users/michael.cameron/Code/Android/darxstudios/TheChefsCodex/app/build/intermediates/exploded-aar/com.android.support/support-v4/21.0.3/res:/Users/michael.cameron/Code/Android/darxstudios/TheChefsCodex/app/build/intermediates/exploded-aar/com.android.support/support-v4/21.0.3/classes.jar:/Users/michael.cameron/Code/Android/darxstudios/TheChefsCodex/app/build/intermediates/exploded-aar/com.android.support/support-v4/21.0.3/libs/internal_impl-21.0.3.jar:/Users/michael.cameron/Code/Android/darxstudios/TheChefsCodex/app/libs/Parse-1.8.0.jar:/Users/michael.cameron/.gradle/caches/modules-2/files-2.1/com.parse.bolts/bolts-android/1.1.4/129874135e6081269ace2312092031558865de12/bolts-android-1.1.4.jar:/Users/michael.cameron/Code/Android/darxstudios/TheChefsCodex/app/libs/bolts-android-1.1.4.jar" com.intellij.rt.execution.application.AppMain com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 com.darxstudios.thechefscodex.ApplicationTest
Exception in thread "main" java.lang.NoClassDefFoundError: junit/textui/ResultPrinter
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:191)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:116)
Caused by: java.lang.ClassNotFoundException: junit.textui.ResultPrinter
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 3 more
it may also be related to when i tap the open Android Studio icon in my Dock i get the error no JVM was found but i can open it via Terminal no problem.
This is the same as a brand new android studio project with the default applicationTest trying to run.
So two things
First, if you try to open Android Studio on Yosemite upgrade and it says "No JVM found" you need to install the java 6 for osx here as Android requires java 1.6 and not java 1.6+.
Second, The Exception I found was caused because it was trying to run JUnit as if I wanted to run through java standard console instead of with Android.
Do not use the Java test that contains a black with arrows, use the unit tests within a Android Tests and delete all uses of the JUnit configuration.
Your configuration should look like this, then you can right click on single tests and run them like normal.
As of the release of Android Studio 1.1.0 (on Feb 18 2015), it is now possible to run standard JUnit tests in Android Studio on local JVM for as long as the code under test isn't calling Android API. Please follow the instructions in this guide for more info.
I had download project from github and I want to import it into android studio. I tried several time but I cant run it. Any one give the step by step instruction to import the project because am new one for android studio.
Showing Error:
"C:\Program Files\Java\jdk1.8.0_25\bin\java" -ea -Didea.launcher.port=7532 -Didea.launcher.bin.path=D:\Users\SYS\AppData\Local\Android\android-studio\bin -Dfile.encoding=UTF-8 -classpath "D:\Users\SYS\AppData\Local\Android\android-studio\lib\idea_rt.jar;D:\Users\SYS\AppData\Local\Android\android-studio\plugins\junit\lib\junit-rt.jar;D:\Android By Timothy\Package tools\adt-bundle-windows-x86_64-20131030\adt-bundle-windows-x86_64-20131030\sdk\platforms\android-21\android.jar;D:\Android By Timothy\Package tools\adt-bundle-windows-x86_64-20131030\adt-bundle-windows-x86_64-20131030\sdk\platforms\android-21\data\res;D:\Android By Timothy\Package tools\adt-bundle-windows-x86_64-20131030\adt-bundle-windows-x86_64-20131030\sdk\tools\support\annotations.jar" com.intellij.rt.execution.application.AppMain com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 #C:\Users\SYS\AppData\Local\Temp\idea_junit7097204602616052537.tmp #w#C:\Users\SYS\AppData\Local\Temp\idea_working_dirs_junit3836436993075423504.tmp -socket54727
Exception in thread "main" java.lang.NoClassDefFoundError: junit/textui/ResultPrinter
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:260)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:116)
Caused by: java.lang.ClassNotFoundException: junit.textui.ResultPrinter
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 3 more
Process finished with exit code 1
Now i got error:
11:51:25 UnsupportedMethodException
Failed to set up Android modules in project 'Telegram-master': Unsupported method: SourceProvider.getJniDirectories().
The version of Gradle you connect to does not support that method.
To resolve the problem you can change/upgrade the target version of Gradle you connect to.
Alternatively, you can ignore this exception and read other information from the model.
I tried, and here is steps:
Git clone the project to you disk
Import project on your Android Studio.
There was one Error of gradle. Change the gradle version to latest 1.0.0, such that
"classpath 'com.android.tools.build:gradle:1.0.0'
Get your own api_id form here.
Follow the doc.
EDIT
For 'signingConfig.storeFile' does not exist problem:
1: Look if you have the debug.keystore in (~/.android or search your whole android folder). If you haven't got it. Look this (There is no debug.keystore in .android folder) for create a debug.keystore.
2: When you have the file. You have to copy the file('debug.keystore') on (Telegram/TMessagesProj/config).
I am getting the following error
Exception in thread "main" java.lang.NoClassDefFoundError: org/jsoup/Jsoup
at Main.main(Main.java:42)
Caused by: java.lang.ClassNotFoundException: org.jsoup.Jsoup
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 1 more
Now what I have done so far:
I created a libs folder in my project folder and added the Jsoup.jar there. Then in eclipse I click properties, add external Jar and added it. I see the referenced library.
But the issue still persist. I dont get compilation errors. So this is a runtime issue. Appreciate the help.
Edit:
I have found the following
If I compile using
javac -classpath /path/to/jsoup.jar myclass.java
and then
java -classpath /path/to/jsoup.jar myclass
It runs perfect.
Now. This is not working for me because I am going to use my application on a computer that does not have Jsoup. So how to I resolve this runtime issue?
Go to Run configurations... menu and check classpath for Run task. It looks like you add library for Compilation step, but it doesn't set at Run step.
Edit (after comment)
I dove into the issue and found that this dependency is needed for application container. So you just need to add this library to classpath of your app server. If you use Tomcat, just put the library to the %CATALINA_HOME%\lib directory.
I'm getting following exception when open my GWT app in development mode. the exact same code can compile successfully using mvn gwt:compile
Caused by: java.lang.ArrayIndexOutOfBoundsException: 3667 at
com.google.gwt.dev.asm.ClassReader.readClass(ClassReader.java:1976)
at com.google.gwt.dev.asm.ClassReader.accept(ClassReader.java:464)
at com.google.gwt.dev.asm.ClassReader.accept(ClassReader.java:420)
at
com.google.gwt.dev.shell.rewrite.HasAnnotation.hasAnnotation(HasAnnotation.java:45)
at
com.google.gwt.dev.shell.CompilingClassLoader.findClass(CompilingClassLoader.java:1100)
at
com.google.gwt.dev.shell.CompilingClassLoader.loadClass(CompilingClassLoader.java:1203)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247) at
java.lang.Class.forName0(Native Method) at
java.lang.Class.forName(Class.java:247) at
com.google.gwt.dev.shell.ModuleSpace.loadClassFromSourceName(ModuleSpace.java:665)
at
com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:468)
at
com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49)
at com.google.gwt.core.shared.GWT.create(GWT.java:57) at
com.google.gwt.core.client.GWT.create(GWT.java:85) at ...
I overdid ModuleSpace.java and printed out the class name at line 665 before Class.forName() which points out it is trying to load the generated GinjectorImpl.java
I found out my generated GinjectorImpl.java is about 9MB and with 100K+ lines of code.
When I randomly remove some modules from my GWT app it works again, so I'm guessing it is too large for ASM to compile.
Any suggestions? Thanks
Environment:
GWT 2.5.0, GIN 1.5.0, gwt-maven-plugin 2.5.0, Java 6 SE
Try deleting the gwt-unitCache folder and run a gwt-compile again. This fixed it for me.
Upgrade GIN to 2.0.0 fixed my problem
size of the generated Ginjector.java shrink from 110K+ lines to 23 lines :)