Can't import Jena classes - eclipse

I'm setting up Jena in eclipse. However, when I try to import any class, such as the Model class, I am getting the error "The import com.hp cannot be resolved". I already set up the build path to the Jena library. Below is a picture of my simple setup and as you can see I am getting an error on the import statement.
http://imgur.com/Z1tfF5f

The package tree starts org.apache.jena for Jena version 3 onwards. Your IDE can help by finding the class Model

Related

Type mismatch junit5 #ExtendWith

so this is probably a really dumb question but I just started to migrate a project from junit 4 to 5 and saw that #RunWith() does not longer exists. It is replaced by #ExtendWith. So I tried to do it like this:
import org.jboss.arquillian.junit.Arquillian;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.extension.ExtendWith;
import de.msggillardon.services.journal.JournalService;
import de.msggillardon.system.UserContext;
import de.msggillardon.util.ITDeployment;
#ExtendWith(Arquillian.class)
.....
And I get the following exception: "Type mismatch: cannot convert from Class to Class <? extends Extension>
I am a really bloody beginner and have no Idea how I can fix the problem.. So maybe someone could help me or tell me where I can find the necessary Information.
Thank you all.
Unfortunately, you can't use JUnit 4's Runner as your JUnit Jupiter (part of JUnit 5) extensions. That's a completely new API and not compatible.
Although the JUnit Jupiter programming model and extension model will
not support JUnit 4 features such as Rules and Runners natively, it is
not expected that source code maintainers will need to update all of
their existing tests, test extensions, and custom build test
infrastructure to migrate to JUnit Jupiter. From the official JUnit documentation
So for each #RunWith, you need to use/include the JUnit Jupiter extension. In your particular case of Arquilian, I'm not quite sure if there is already an official extension for this.
The following links might help:
https://developer.jboss.org/thread/274569
https://github.com/arquillian/arquillian-core/issues/137
Arquillian now support junit 5.
Replace
#RunWith(Arquallian.class)
with
#ExtendWith(ArquillianExtension.class)
Also add the new dependency
<dependency>
<groupId>org.jboss.arquillian.junit5</groupId>
<artifactId>arquillian-junit5-container</artifactId>
<version>1.7.0.Alpha10</version>
</dependency>

Scala/Spark/Databricks: How to import code from user-created JAR?

I have a JAR that I created with intellij and sbt, that defines a case class and Object. I've uploaded it to my databricks workspace, and attached it to a cluster as a library.
How do I actually import code from it/reference it in my notebook? So far all I can think of is to try
import NameOfJar._
which gives
java.lang.NoClassDefFoundError: DataFrameComparison$
Do I need to have built the jar differently somehow? (Package statement or something?)
you should import import packageName._, jar name is not used in import statement. It should work the same as in usual local java/scala code.
You can check this article for details - https://docs.databricks.com/libraries.html
Btw, does your notebook fail on import itself, or later, when you're trying to use class, that exists inside jar?

Cannot import external JAVA library using Jython in Eclipse

I'm new to Jython and to Eclipse. I'm trying to use the JGraphX JAVA library. I've created a new PyDev project and package. I've right-clicked on the project properties in Eclipse, selected "PyDev - PYTHONPATH" and added jgraphx.jar. In the init.py file, I've tried:
import jgraphx as jgx
from jgraphx import *
Neither approach works. The code is underlined as an error in Eclipse. When I run, I get "ImportError: No module named jgraphx". What am I doing wrong?
Thank you,
-david
I'm not familiar with the JGraphX library.
To import a java class
you need to use from my.project.package import someclass

import scala.swing._ in eclipse giving an error that it is not a member of package scala

Does anybody have any experience with trying to get swing to work in eclipse, I can import it fine into scala using the command line interface, but when i try and use it in an eclipse scala project I get the following error:
import scala.swing._
"object swing is not a member of package scala"
Any help would be much appreciated.
If you are missing the library (as RĂ¼diger said, it is a separate dependency now), you can find how to add it to your build system here (for Scala 2.11):
http://search.maven.org/#artifactdetails|org.scala-lang.modules|scala-swing_2.11|1.0.1|bundle
Look under "Dependency Information", e.g. for sbt if you use that.

Cannot import Appengine modules in Eclipse

In my Eclipse project (GWT) I am trying to import the modules below, in order to add some Blobstore code.
import com.google.appengine.api.files.FileService;
import com.google.appengine.api.files.FileServiceFactory;
I don't get any error or warning from the Eclipse build function. Nevertheless, when I do "GWT compile" from Eclipse, I get the error messages below:
[ERROR] Line 3: The import com.google.appengine.api.files cannot be resolved
[ERROR] Line 4: The import com.google.appengine.api.files cannot be resolved
How can I sort it out? Thanks!
You cannot reference non-client code from your GWT client. Remember that your GWT client code will be compiled to Javascript, so any references to actual Java can't be compiled out.
Make sure any reference to the blobstore api is done in server code, not client. Those imports should never be necessary in code that must be compilable to javascript.