Importing GraphStream library in NetBeans 8.0 - java

I am just getting started with GraphStream and using NetBeans as an IDE in my laptop (Yosemite 10.10). I already downloaded and included .jar library file into my project:
My problem is I still can’t import graphstream in my class. This is what I wrote:
import org.graphstream.graph.*;
but I’m still getting the error message
Package import org.graphstream.graph.* doesn’t exist
Is there any way to import GraphStream in my NetBeans? Any help would be appreciated. Thank you.

You have to extract those 3 gs-*.zip files that you downloaded from the website. Then, inside the extracted folders you will find gs-*.jar files. These are the actual binaries that Netbeans needs as dependencies.

Related

The import jdk.nashorn cannot be resolved

I am trying to import a project into my eclipse workspace. When I maven updated the project, this dependency is not getting downloaded.
When I searched online, I found that jdk.nashorn is not supported from java 11 onwards. But I am using java 1.8.0_231, still its not working for me.
The code uses below class from the library.
import jdk.nashorn.internal.ir.debug.ObjectSizeCalculator;
ObjectSizeCalculator.getObjectSize(modRespList)
Is there any way to make this code work?

NO NETBEANS PROJECTS ADDED Error

I am trying to import a projetc (in ZIP file) in my netbeans8.2. It is downloaded from GitHub (link: https://github.com/wdalmut/vanet). While importing the project from Zip it shows the error and no project becomes imported. Why this happening and how can I run a complete project into netbeans 8.2 ?
The import from zip option in netbeans doesn't support importing anything, its only meant to import other netbeans projects that have been packed as a zip file. If you want to import existing code into netbeans you will need to do so manually. For help doing this you can refer to this article on the netbeans site.

How to import the java code as a project to IDE?

I download a API form USPS, and when I tried to import them to my IDE(netbeans), I got error message. So I tried Eclipse is also not work.
So, is there a way to import them to my IDE? :)
in netbeans IDE add them as library.
click on your project node you will see library node and then right click on library node you can add jar or library to your own project.

Trying to import NetBeans Project from an older version using .forms

I'm trying to import a NetBeans project from an older version (6.9.1) to the latest (8.0). I've gotten the necessary forms with a few .java files too. I try importing them from a .zip file but it tells "No NetBeans projects added" after telling me they already exist.
Please help.
Thank you :)
Perhaps the file format has changed? There is no backward compatibility guaranteed for such a a old NB version, you are coming from.
But the following should work: Import your 6.9.1 projects into 7.0.1 and export them. Then import the exported into 7.1 and export gain. Then imported the exported project (from 7.1) into 7.2 and export... (you get the idea)

Creating a Java jar library to use on Android project

I am working on developing a game for Android and I have a lot of the code written on a java application. I would like to use the classes and methods in the Java application within my Android application. I am using Eclipse to develop my application so I tried to create a Jar for the Java application By doing: Right click project->Export->Jar I then saved the jar somewhere and added the jar to my Android buildpath. When I try to use methods from that jar I get compilation errors because Eclipse cant find the methods. Am I supposed to have any import statements? The name of the package on my java app is (default package) so I am not sure what the import statement would be. I would appreciate any help.
EDIT: I changed the package name of my application so that I could import the classes within it and that got rid of the compilation errors. When I try to run the project I now get NoClassDefFoundError Could it be that I am exporting the jar for my Java application wrong?
Open Project properties -> Java Build Path -> Order and Report tab.
Try to check jar check boxes,
see example:
To make sure that you created jar properly, here other snapshot of jar export:
Rename the package first. http://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html
Yes, you need to import the package inorder to use in a class. Else the compiler will not identify the codes. Import the jar into build path and import the package into the Java code as :
import java.util.HashMap;
If I understand your correctly you exporting a Java .jar (built using Java compiler)? As far as I know Android does not understand Java bytecode though the compiler for Android understands Java source code.
I'd suggest you just put all that source files in the Android project and compile them there, hopefully you aren't using functions that Android API does not have.

Categories