import java.rmi.Naming;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.util.*;
import java.util.List;
import java.util.Map;
public class JavaApplication60 {


public class EncyclopediaServiceImpl extends UnicastRemoteObject implements EncyclopediaService {
    private List<String> encyclopedia;

    public EncyclopediaServiceImpl() throws RemoteException {
        super();
        encyclopedia = generateRandomData(300);
    }

    private List<String> generateRandomData(int numWords) {
        List<String> words = new ArrayList<>();
        Random random = new Random();

        for (int i = 0; i < numWords; i++) {
            int wordLength = random.nextInt(10) + 1; // Random word length between 1 and 10 characters
            StringBuilder word = new StringBuilder();

            for (int j = 0; j < wordLength; j++) {
                char c = (char) (random.nextInt(26) + 'a'); // Random lowercase letter
                word.append(c);
            }

            words.add(word.toString());
        }

        return words;
    }

    @Override
    public int count() {
        int letterCount = 0;

        for (String word : encyclopedia) {
            letterCount += word.length();
        }

        return letterCount;
    }

    @Override
    public List<String> repeatedWords() {
        Set<String> uniqueWords = new HashSet<>();
        List<String> repeatedWords = new ArrayList<>();

        for (String word : encyclopedia) {
            if (!uniqueWords.add(word)) {
                repeatedWords.add(word);
            }
        }

        return repeatedWords;
    }

    @Override
    public String longest() {
        String longestWord = "";

        for (String word : encyclopedia) {
            if (word.length() > longestWord.length()) {
                longestWord = word;
            }
        }

        return longestWord;
    }

    @Override
    public String shortest() {
        String shortestWord = "";

        if (!encyclopedia.isEmpty()) {
            shortestWord = encyclopedia.get(0);

            for (String word : encyclopedia) {
                if (word.length() < shortestWord.length()) {
                    shortestWord = word;
                }
            }
        }

        return shortestWord;
    }

    @Override
    public Map<String, Integer> repeat() {
        Map<String, Integer> wordCount = new HashMap<>();

        for (String word : encyclopedia) {
            wordCount.put(word, wordCount.getOrDefault(word, 0) + 1);
        }

        return wordCount;
    }

    @Override
    public List<String> getData() {
        return null;
    }
}

    /**
     *
     * @param args
     */


/**
 *
 * @author ismai
 */
public interface EncyclopediaService extends Remote {
    int count() throws RemoteException;
    List<String> repeatedWords() throws RemoteException;
    String longest() throws RemoteException;
    String shortest() throws RemoteException;
    Map<String, Integer> repeat() throws RemoteException;

    List<String> getData();
}

    public static void main(String[] args) {
        try {
            EncyclopediaService service;  // Create an instance of the class
            service = new EncyclopediaServiceImpl();
            Naming.rebind("//localhost/encyclopedia", service);
            System.out.println("Encyclopedia service bound and ready to use.");
        } catch (Exception e) {
            System.err.println("Error: " + e.getMessage());
            e.printStackTrace();
        }
    }
}
EncyclopediaService service = new EncyclopediaServiceImpl();
 Error: Uncompilable code - non-static variable this cannot be referenced from a static context
java.lang.RuntimeException: Uncompilable code - non-static variable this cannot be referenced from a static context
	at javaapplication60.JavaApplication60.main(JavaApplication60.java:1) Solve this error for me