Importing a library in a netbeans 7 project - netbeans-7

I have added the following jar file to my project in netbeans:
json-lib-2.4-jdk15-sources.jar
I did this by right clicking 'Libraries', and clicking 'Add JAR/Folder'
The problem I have is when I try to access this library in my code. I try the following:
import net.sf.json.JSONObject;
but I get the message 'package net.sf.json.JSONObject does not exist'.
Any help?

Use
CTRL + SHIFT + i
netbeans would automatically import the required libraries.

Ok, I just figured it out!
I was importing the wrong JSON jar file
The file 'json-lib-2.4-jdk15-sources.jar' is wrong.
It's supposed to be 'json-lib-2.4-jdk15.jar'

Related

Error during renaming a package in B1if Integration Framework BPE139 Failure to obtain a lock

I'm trying to rename a disable package in business one integration framework, and i get this error :
Any idea how this could be fix !?
There can be an error in the file so try to rename the package in the xml file. Export the package and then find the xml line where the name is defined. Change it and import the changed package. I had trouble with some funktions in some browers so maybe try an other one.

Not able to show image (API setDrawIcons() not found error)

I am using MPAndroidChart in our android project to show graph and it's very helpful. Using latest version 3.0.1 (https://github.com/PhilJay/MPAndroidChart#usage)
I have some requirement to show image on top of BarEntry after some condition met. Same is working in example code downloaded.
BarDataSet set1;
set1.setDrawIcons(true);// Cannot resolve method 'setDrawIcons(boolen)
Why the above API is not part of library MPChartLib, am I missing something here?
Above problem got solved after integrating MPChartLib source code.
File -> Project Structure
click plus button to add New Module
Import Gradle Project
from Source directory: and finish.
The setDrawIcons method was added in 3.0.2. Change your Gradle option to read compile 'com.github.PhilJay:MPAndroidChart:v3.0.2'

IntelliJ System.out.println() - Cannot resolve method println(java.lang.String)

I am using IntelliJ IDEA, learning Java. All went well until yesterday, when the mentioned error occurred.
I didn't make any changes. I was looking for the solution the following ways:
reboot the pc
restart IntelliJ.
delete the project directory and use another one (both on desktop)
nothing helps. buy running simple hello world method. It keeps showing this error:
Is there someone able to help me?
ok, is solved.
file -> invalidated caches / Restart
One reason for this to happen is if you have print statement somewhere on the body of the class, and not inside a method.
Here is an example:
But if the print is inside a method, it should work fine.
Here is an example:
I think if you have tried the method above, maybe you can consider where you use System.out.println() because this method should only used in main(String args[]){},the latest version of the Idea is OK. I wish what said can help you.
If you have orcale sdk configured as your project sdk there is no way System.out.println can't be found - besides you are using another System.out.
So my guess is that you don't have a proper project sdk configured.
Goto to Project Settings or press Ctrl+Alt+Shift+S, go to Project Settings -> Project and check if your sdk is setup correctly.
In my case my project was set up to Java 6th and I had installed jre1.8.0_131 which I assume was causing the problem. After changing Java to level 8 problem have been solved.
Press Ctrl+Alt+Shift+s or go to File -> Project Structure -> Project, and set Project Language Level to yours.
case 1: if all sdk setup is complete and perfect
then
file -> invalidated caches / Restart
this could work
case 2 : if something missing in sdk setup of intelij
then goto
1.file->project structure->libraries
2.click on + button
3. add location of lib folder of tomcat directory
C:\xampp\tomcat\lib
to add lib directory to tomcat
import static java.lang.System.out;
Or do you possibly have more than one class named System?
Or possibly this link could be of use to you.
Just make sure that your SDK in the setting of INTELIJI is set up have a look here
I had that problem because I pulled the repository from work where we have java 8, but on my private computer, I have 17..

Play Framework & IntelliJ - Cannot resolve symbol index/routes

I'm new to playframework/intellij and I have finally managed to import a play-java-intro succesfully (yey!), but when I try to edit the Application.java file, I see the error shown in the picture below "Cannot resolve symbol index" and "Cannot resolve symbol routes".
What does this mean? How do I get rid of these errors/warnings?
I have tried to run the program aswell to see if it works, and the project works. This means that the errors are showing false.
Also, how do I refresh the project in IntelliJ? I once managed to do this, but that was after a popup came in the topright corner. I have never managed to find the refresh button after that. Just a "Synchronize Project", which does nothing.
Do as following:
1- In intelliJ navigate to Project Structure > Modules
2- In the sources tab find target > scala_2.11 > src_managed > main and click on it.
3- Mark in as 'Sources' by clicking the button on top of browsing pane.
4- Click OK
That should be it.
I was having a similar issue and I Have updated my IntelliJ to version 2017.3 and everything is working fine now.
In Intellij 2022 try running sbt run once and hit the url (e.g localhost:9000) .
Tested on Play official samples

Cannot resolve method 'ok(?)' with Play 2 Framework in Intellij

I have been trying to get play set up in IntelliJ for hours but I can't get it to work correctly.
I continuously get this error: http://imgur.com/MYY8fXI
I have tried create a project though the terminal with:
play new
and then using the terminal to create the idea files with
idea with-sources=yes
I have also installed the play 2 plugin and used it to create the project, but I get the same error.
I am able to use the plugin I downloaded to successfully run the app and view it in my browser, but I keep getting the
Cannot resolve method 'ok(?)' error.
edit: I am using OSX, and have the ultimate version of Intellij.
edit 2: I have made a little progress. If I import the view directly using import views.html.index; it gets rid of the errors on the application. However, if I use import views.html.*; it results in the errors. Any ideas?
At the time of this writing, it seems that play2 support in IntelliJ 13 Ultimate has some minor problems...
How I did solve the issues:
1) Navigate to your project director and start your play console (play.bat / play.sh should be on the PATH)
2) enter command 'compile' in your play console
3) enter command 'idea" in your play console
4a) in case your IntelliJ project was alread open, IntelliJ will detect the changes and suggest to reload the project. Confirm you want to reload
4b) in case IntelliJ was not running, open the project by File | Open... and select your project Directory.
These steps should resolve your issue.
Does it help to make sure that play has compiled the templates to class files, 'run' + open in browser or 'compile'?