EdgeType.DIRECTED not working - java

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

Related

IntelliJ can't see Desktop class?

So the problem is that IntelliJ just can not locate Desktop class. In fact it can not locate the whole java.awt package as far as I can see. I tried adding directory with those classes to CLASSPATH, but it didn't work. Neither did updating the SDK.
Has anyone ever had similar problem and could give me a solution to it?
Okay, so I have managed to find solution to this question.
requires java.desktop;
This line has to be in module-info.java and everything will work fine.

Package Structure In Maven

I have created a maven project on my Mac using Eclipse. My package structure comes in a folder and its hard for me to create a java class. Packages also do not show up.
How can I fix it? tried googling no solution? please help.

How to install apache river on eclipse

I have a class where we have to use apache river for our work and assignment and I’m trying to install it at home.
I'm fairly new to apache-river and I have installed plug-ins for eclipse before, but this seems a bit more tricky or maybe I'm doing it wrong.
I've looked at https://river.apache.org/ and I've downloaded the zip file and extracted it but I’m not sure what to do with it after that. I'm not even sure that, that is the right download I need.
Any help would be appreciated, thanks.
Please correct me if I misunderstood your question.
I believe you want to import whatever it is Apache River has to offer in Eclipse such that you can use classes in Apache River in your project. Correct?
If yes, this is what i did -
Downloaded apache-river2.2.2.bin.zip from the site you mentioned, extracted it.
Created new Java Project in Eclipse with a trial class.
Configured build path of this Eclipse project, and added all the jars from the /lib folder as 'External Jars'.
All these jars showed up in the Referenced Libraries section in my project in Eclipse.
I tried a sample line of code to see if I get classes from Apache river.
for eg -
LookupLocator locator = new LookupLocator(arg0);
And it worked - Eclipse added
import net.jini.core.discovery.LookupLocator;
automatically.
I checked and this class comes from the jini-core.jar
Of course, if you are using other build / dependency management tools like maven/ant, this eclipse process will differ a little bit.
Let me know if this worked for you.

Cannot resolve symbols yet library is imported

I'm using libGDX and I've cloned a project down from a repo I pushed too earlier. I've set the project up and imported it to Intellij IDEA but it's giving me import errors. I can actually navigate to the classes that are giving me an error but the IDE doesn't seem to recognise them.
How can I fix this?
When you hover over the unused import Intellij IDEA pops up a little red bulb which allows you to add the library to the classpath. Finding that fixed it.

Steps to resolve the imports in eclipse?

Firstly, I have seen several question related to this issue but it seems like those questions might be some steps ahead of my understanding.
I am fairly new to java and consider myself as a self learning beginner. Mostly I face this problem where I do an import. I need it because that import is linked with the use of some really nice and powerful function(s), but always fail if import does not work and end up not using that.
The message is, e.g. "The import com.google can not be resolved".
I have been using eclipse in Ubuntu.
After trying some of the given solutions without being able to view them in the proper context, I already have messed up my eclipse environment and the trouble is still there.
Can anybody kindly show me the complete steps of doing these imports successfully in eclipse for java?
For using 3rd party jars you need to add the jars in the build path.
Follow the following step
right click project
click build path
click libraries tab
then add external jar
Now give the path of the jar location

Categories