JabRef 4.0 packages haven't founded

Dears,

I’m trying to create a java class compiling a program that need import the follow packages (from JabRef 4.0):

import net.sf.jabref.logic.importer.Importer;
import net.sf.jabref.logic.importer.ParserResult;
import net.sf.jabref.logic.util.FileExtensions;
import net.sf.jabref.model.entry.BibEntry;
import net.sf.jabref.model.entry.BibtexEntryTypes;

The compiler javac (8.0.1520.16 version number) told me that packages haven’t founded. Could anyone tell me where are they in JabRef 4.0?

Thanks for all,

Mauricio.

We now use org.jabref as a prefix instead of the old net.sf.jabref. Thus, for example BibEntry is located in org.jabref.model.entry. If you still can’t find a class, just type its name in https://github.com/JabRef/jabref/find/master.

Out of interest: what kind of program do you try to write/compile?

Hello, Tobias, thank you so much for help. Unfortunely, I still can’t find these class and visited the link that you sended me. For example, for Importer package the path showed is jabref/src/main/java/org/jabref/logic/importer/Importer.java. I changed “/” for “.” and the problem continuos.

This is the program:

import java.io.BufferedReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import src.main.java.org.jabref.logic.importer.Importer;
import src.main.java.org.jabref.logic.importer.ParserResult;
import src.main.java.org.jabref.logic.util.FileExtensions;
import src.main.java.org.jabref.model.entry.BibEntry;
import src.main.java.org.jabref.model.entry.BibtexEntryTypes;

public class ImportarReferencias extends Importer {

public String getName() {
    return "Simple CSV Importer";
}

public FileExtensions getExtensions() {
    return FileExtensions.TXT;
}

public String getDescription() {
    return "Imports CSV files, where every field is separated by a semicolon.";
}

public boolean isRecognizedFormat(BufferedReader reader) {
    return true; // this is discouraged except for demonstration purposes
}

public ParserResult importDatabase(BufferedReader input) throws IOException {
    List<BibEntry> bibitems = new ArrayList<>();

    String line = input.readLine();
    while (line != null) {
        if (!line.trim().isEmpty()) {
            String[] fields = line.split(";");
            BibEntry be = new BibEntry();
            be.setType(BibtexEntryTypes.TECHREPORT);
            be.setField("year", fields[0]);
            be.setField("author", fields[1]);
            be.setField("title", fields[2]);
            bibitems.add(be);
            line = input.readLine();
        }
    }
    return new ParserResult(bibitems);
}

}

If you remove the import statements from your source code and call the auto import function of your IDE, then chances are it will find the classes (assuming they are on your build path).

Thanks, Joerg, but can i do it by a import statement at source code? I searched this function at GitHub library and hasn’t founded.

It should be import org.jabref.logic.importer.Importer (without src.main.java) and similarly for the the other imports.