My code compiles in IntelliJ Idea, but not on the server. I get "duplicate class" and "bad source file" errors. How can I solve this?
package com.codegym.task.task15.task1525;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/*
File in a static block
*/
public class Solution {
public static List<String> lines = new ArrayList<>();
static {
try {
String s;
FileReader f = new FileReader(Statics.FILE_NAME);
BufferedReader b = new BufferedReader(f);
while((s = b.readLine())!= null) {
lines.add(s);
}
b.close();
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
System.out.println(lines);
}
}