Added JAR File in Library - buy cannot use - netbeans-8

I added a JAR file into the Netbeand (v8) library and added the jar to the compile and file tabs. When I add the import clause, Netbeans is telling me that the library is incorrect. After reading everything I can on what is supposed to be easy, this is getting very frustrating for this newbie. Am I missing an essential step before I can use this library?

Answered by fixing my own typo. Fixed and works.

Related

Installing dependencys with Gradle Kotlin DSL does not work

Hi everyone I am new to IntelliJ in general and especially to Gradle and I feel like a total noob. :D
Im not sure if this is a Kotlin DSL thing or if I just do it the wrong way and it wouldn't work in Groovey either.
After hours of trial and error and reading other SO posts I'm still not able to install a simple dependency... it can't be that hard...
Currently I am playing around with Jetpack Compose for Desktop even though it's still in alpha and it works but for the love of god I am not able to add a dependency.
So here is my Problem:
I try to install the dependency like they say I should in
https://developer.android.com/jetpack/compose/navigation#kts
and yes I know it's an android package so it may not compile or it may crash during runtime but shouldn't it at least find and download the dependency???
So... if I add
implementation("androidx.navigation:navigation-compose:2.4.0-alpha10")
to my build.gradle.kts
And try to compile it I get an exception during the build process:
What I tried so far:
I checked if the repository maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
who is configured in my build.gradle.kts repositories-section and in my settings.gradle.kts pluginManagement-section contains the package that I want.
The site https://mvnrepository.com/artifact/androidx.navigation/navigation-compose?repo=space-public-compose-dev tells me, that the repository contains the package that I need.
I checked the error log itself.
But I don't relly know what it tries to say.
I use Java SDK16, since I expect downward compatibility and the fact that the dependency is still in alpha I assume it should be compatible.
I use Kotlin 1.5....
that's it.
Thanks for reading all that :) I really appreciate your time... If I forgot some crucial information let me know and I will add it as soon as I can.
the problem which I feel is, is you are basically opening the wrong file. (I don't use jetpack compose so the answer might differ)
on the top left corner in the image, where there is project dropdown, open it and select android.
now there will be a different set of files in the Gradle folder, in fact, there will be 2 different files in that folder.
build.gradle (project: <project_name>)
build.gradle (Module: <project_name>.app)
open the second file and there will be dependencies copy + paste implementation code there.
the file which you have opened is actually the first file.
Well... here I am back again answering my own question.
After I switched to the terminal in IntelliJ Idea (which to be honest I could have thought of that prior to posting my question) there was highlighted text that gave me the necessary insight, why it wasn't working.
And after some searching the web in order to find out what an "aar" file is and why I didn't get a jar file like I expected it turns out that android has it's own little file format for android applications and that those cannot be used in regular java/kotlin projects.
I read somewhere, that 'aar' files contain a jar file and some other stuff and extracting the jar file from the aar file may be a way to get it working, but it didn't fix anything, maybe because the dependencies of the navigation package are aar files as well and therefor I'd need those packages as well and extract the jar file from those as well and it all seems like this isn't the right way...
So I guess I have to wait until Jetpack Compose for desktop somehow is able to use aar files or until the repositories deliver the packages in a regular jar file.

Why is my library not being recognized after importing my project?

I'm using the JDBC library in my IntelliJ project (mysql-connector-java-5.1.40-bin.jar)
I put it into a folder named lib and used right click > Add as Library to add it as a library. It worked fine.
Later, I zipped the project and moved it to another computer. After unzipping it and importing it in IntelliJ, it gave me the error SQLException: No suitable driver found for jdbc:mysql, which means that it couldn't find the library.
I looked through the file explorer in IntelliJ and it showed both the jar and XML file, and the XML file was pointing to the right location (jar://$PROJECT_DIR$/lib/mysql-connector-java-5.1.40-bin.jar).
I added the jar file as a library again and now it works. But how can I make it work without having to readd it each time?
Use Gradle (or Maven) for building and dependency management. IDEA should import a Gradle (or Maven) project just fine.
The problem was that I was overwriting the IntelliJ Module Library (.iml) file.
When you import a project to the same folder, IntelliJ asks you whether you want to overwrite or reuse the IML file. Since Overwrite was the default option, I selected it, but that caused it to forget what libraries it was using.
By choosing Reuse instead, it works perfectly.

Some classes can't be resolved when compiling Apache Drill?

I built the Drill project according to the wiki specification
but, the project has some errors. Some classes (BigIntVector, BitHolder,BigIntHolder) can't be resolved and the workspace don't really contain these class files. Any suggestions as to what's going on?
These clases are generated during build.
exec/java-exec/target/generated-sources/org/apache/drill/exec/expr/holders/BigIntHolder.java
There is a problem in that the Maven import into eclipse results in target/generated-sources/org being added to the Source Folder build path. I have found that in the two cases, comon and java-exec, if you remove these folders from the source folder build path and add them as target/generated-sources this will help.
This is a workaround, there is obviously a misconfigured pom.xml somewhere.

Having trouble importing RegexKit into an Xcode 4 project

I am using XCode 4, trying to import the RegexKit framework into my project so that I can use regular expressions for some text parsing code. The framework is installed by default into the /Developer/Local/Frameworks folder, and I was able to import it into my project via Project > Build Phases > Link With Binary Libraries and Project > Build Phases > Copy Files (although I cannot drag the added framework into the frameworks folder or it breaks, yay XCode 4...).
The trouble is, now that I seem to have the framework imported, I cannot actually use it in my code. The import statement should be (according to the documentation)
#import <RegexKit/RegexKit.h>
but that code isn't auto-completing and is being flagged as a file not found error. When I begin typing that line, I do get an option to auto-complete
#import "RegexKit.h"
but it too gets a file not found error. What am I doing wrong, this is driving me nuts!?!?!
Okay, I solved it. It turns out that you have to add the framework to the testing target as well (yeah I left out some key info there, sorry. The file in question was actually a test case). I hope this helps someone!

Importing which library?

recently I downloaded this open source project and I am trying to compile it.
However, one of the line is giving me an error.
"import com.sun.org.apache.xpath.internal.functions.WrongNumberArgsException;"
Seems that i am missing a library.... is there a way to know WHICH library do I need?
I tried searching on google for com.sun.org.apache.xpath.internal.functions,
while there seem to be a result on kickjava.com/src containing the source code.
I think i need the Jar file right?
I tried downloading xalan from apache and it didn't work.
I tried to see if there's a xpath library, but I dont think there's a xpath library?
searching for xpath led me to xalan.
I have also tried Xerces-J-bin.2.9.1 .
Thanks!
The WrongNumberArgsException class in Xalan is in the org.apache.xpath.functions package. With the Xalan jar in your project, you should just be able to change the import statement in the open source code to use the correct path.
The OpenSource author (what ever "this open source project" is) imported the internal exception class from the sun adopted xalan classes in Java 6. This should not be done at all! Will not work with older VMs and may be broken with later ones.
Never import com.sun.*!