I was trying out a simple tutorial for JOGL with eclipse:
http://www.tutorialspoint.com/jogl/jogl_installation.htm
I did as shown, but for some reason all of the javax.media includes are invalid:
The import javax.media cannot be resolved
I imported all of the mentioned jars into the build path. I've done lots of other projects, but importing jars always worked flawlessly for me.
To my impression I either have the wrong jars, I am missing something, or something is broken with the importing.
This is where I got the jars:
http://jogamp.org/deployment/jogamp-current/archive/
Don't use that, it's very outdated, use these instead:
Downloading_and_installing_JOGL
Setting_up_a_JogAmp_project_in_your_favorite_IDE
javax.media is the previous location where in the older jogl versions the GL objects were
Eclipse suggested adding the com.jogamp.jogl project to my project, and when I did that the problem was solved.
Still not sure why just adding the mentioned jars did not work.
Related
I'm fairly new to using JavaFX and have been tinkering with it on my own in a few simple projects.
I have to collaborate with a few others for a main project, where I am seeing this conflicting issue:
I'm having an issue with the src.zip file of javafx. On my standalone projects, I do not encounter this issue. However, since working with others, this error has appeared. Prior to this, I was getting a Kotlin plugin issue, where I had to completely disable Kotlin.
Error:java: C:\Users\nolan\Javalibs\javafx-sdk-11.0.2\lib\src.zip
I'm unsure of what this issue might mean, so any help would be appreciated.
Thank you.
I had the same problem too and discovered it was because I added the JavaFX 11 SDK to Intellij incorrectly. I initially had the added library point to just the directory /lib. Since this directory includes both the jars and src.zip, Intellij will try to run both and produce the error.
To solve this, when Intellij prompts you to "Select Library Files," you need to explicitly select the files within the /lib directory which will then be added as shown here. This will also allow proper inspection of the source code without Intellij having to decompile the class file when ctrl + left clicking a class name.
Figured this out. I extracted the src.zip in the appropriate directory (deleting the zip as well), then had to change my VM Path to include:
--module-path "C:\yourpathto\javafx-sdk-11.0.2\lib;out\production" --add-modules=javafx.controls,javafx.fxml
I forgot to add ;out\production to the Module path.
A quick rebuild then solved this issue.
I've been researching for many hours about a possible solution to this but whatever I try it just fails. Here's the explained situation:
I have this library project on Android Studio which generates the app-debug.aar file.
Then I add this new module in the implementing project, following the wizard to import .JAR/.AARs I pick the .aar and update the dependency for :app in the Project Structure.
Once the project is cleaned (even using ./gradlew clean--Mac OS X) I can make references of this class and its methods in any of the activities.
Now at runtime, once built and installed on the real devices the app will crash throwing the aforementioned Runtime Exception.
Note: I'm importing the .aar because I would need to protect the code and it has resources so a .jar is out of the question. And if I import the library module (with source and all instead of an.aar) then the app has no issues at runtime.
I've tried everything and if anyone can throw some light on what this could be, it'll be highly appreciated.
The class extends ViewGroup and is instantiated at runtime in case that implies anything. The code was given to me so major changes might not be possible unless it's absolutely necessary.
Thanks beforehand to all!
Armando
For those, who are still looking for the solution, following two options worked for me to solve the exact same problem as OP has mentioned.
Include the (problematic) library dependency in the target module as well, i-e the in my case i was including the protobuf-lite as a dependency to my library module but getting noclassdefFound error when lib imported as .aar in app module. As a workaround, i added the protobuf-lite dependency to my app module too and it worked like charm.
Second option that worked for me that instead of adding the gradle dependency `compile 'com.google.protobuf:protobuf-lite:3.0.1', i downloaded the protobuf-jar from maven and added manually to the libs of my library module, and the problem got solved.
Don't know what's wrong with the gradle plugin, but hope it helps someone else looking for the same problem.
The NoClassDefFound error has actually happening to a backward-compatibility library being used by this class I mentioned on the question ("Class A"). No details were given other than Class A couldn't be found and later on found out that another class had a similar issue BUT was pointing at that compat lib with the same exception and I noticed that Class A was also calling its methods and implementing its callbacks. By bumping up the min version (to use the native API) I could overcome that issue. It was indeed a problem of including that backward-comp library in the .aar or so it seems. Should I understand this issue a lot better I'll update this "answer."
I wanted to try out the new LWJGL 3 which is currently in kind of a "beta"-state. Embarrassingly I can't even get the HelloWorld example (http://www.lwjgl.org/guide) to run.
package org.lwjgl.glfw does not exist
is all I get.
I added the lwjgl.jar and disruptor.jar to my module dependencies, but I guess I'm missing something about the natives here. I tried adding them as a lib, as a module (which tells me it's an empty library although there are two .so files in there oO)
I tried setting the -Djava.library.path of course, no success here:
-Djava.library.path=home/teolha/lwjgl-test/lib/natives/linux/x64
I tried invalidating caches, adding it as system lib and about everything I know. Still, the glfw package can't be found.
I'm not sure what I'm doing wrong, but I've never done this in IntelliJ 14, neither with lwjgl 3, so maybe something has completely changed here?
Any help appreciated!
Before anything else, I'm using LWJGL 3 NIGHTLY.
I've just managed to build and launch LWJGL 3's HelloWord. Does this help?
From lwjgl.org/guide:
Add the LWJGL jars to the classpath. This is usually done by setting up a library dependency for your project and attaching jars to it.
In my case, compiling with this worked
javac -cp ../jar/disruptor.jar:../jar/lwjgl.jar: -d . *.java
Set the -Djava.library.path system property (as a JVM launch argument) to the appropriate path for the target OS/architecture
And actually launching the tutorial worked with this.
java -classpath ../jar/disruptor.jar:../jar/lwjgl.jar: -Djava.library.path=../native/linux/x64/ org.lwjgl.demo.glfw.HelloWord
Be sure to adjust the path if needed.
edit: I just realized you were probably asking for a solution with intellij, in which case I'm not sure if this is helpful.
So, well, the error wasn't on my side.
LWJGL 3 is under heavy development currently and the latest stable version wouldn't match the example, thus I had to use the latest nightly.
(The api changed significantly)
My solution is:
Add the jars as libs and add the .so files as lib as well. That way you don't need to specify a library path argument :)
Works like a charm with the new lwjgl-api!
I recently figured out how to add the Jung libraries to eclipse, but now I ran into a new problem. I'm using the Jung tutorial and I can't seem to run the first tutorial, because the Eclipse IDE is saying that the .DIRECTED ,in the code, cannot be resolved or is not a field. How do I fix this?
edit: Yes, using that package worked! However, I'm surprised that the Eclipse IDE did not offer to import the package for me. Is this unusual?
Make sure to include all the required JUNG2 libraries into your Eclipse project. When you do that, Eclipse will give a few suggestions after you right-click on those yellow-underlined words. Choose the one(s) related to JUNG2 to remove the warning(s).
EgeType.DIRECTED must be imported from edu.uci.ics.jung.graph.util.EdgeType package which is under jung-graph-impl-2.0.1.jar
I have a project which has shared functionality between three other projects and have linked these to existing projects as I normally would using the add project functionality of the libraries folder.
This all used to work however when I started up Netbeans yesterday it just wasn't working as in the other projects won't compile even though the projects are linked. It can recognise the packages - just the actual classes themselves were not recognised... and to add to the weirdness some of the classes are getting picked up fine.
I have checked the dist folder of the shared project and the Shared.jar file exists. Also I have checked the Jar and the other classes that are not being recognises are there also.
Any suggestions?
alt text http://inverse.seednet.eu/snaps/duvc6r.png
Solution
I had to reinstall netbeans to get this solution resolved
This is most likely a bug in 6.8, as I have ran into the same problem and I only solved it by recreating the project, was a fairly fast process, only had to re-import the sources and then add the JARs on which it depends.
To confirm this case you only have to see the imports that NetBeans did not find, and then go to the included JARs and see if the class really is there, if it is, then it should be able to find it.
Do you have AbstractCrawler.class compiled to its output location as well?