Q:

If I compile Java app at another location it can not read from any folder

I have an app. Which is in RC state. I've started finalizing works by splitting the classes to separate files with appropriate import sets at another location but suddenly I've found that cleaner version cannot read from any folder. So I investigated that if I compile the code in another location except the actual (original) app cannot read from any folder.
Strange is that from folders from those cannot be read can be obtained path (subdirectories included).
I have packed this app to executable jar file before started this works. Maybe somewhere in JVM is something stuck?
Note: New files are compiled without error. I've tried both original source and new sources.
Failure is in methods File.list() or File.listFiles(). The same using directory stream.
Used packages:
import javax.swing.JFrame;
import javax.swing.JTabbedPane;
import javax.swing.JFileChooser;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.table.DefaultTableModel;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Color;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

import java.io.LineNumberReader;
import java.io.FileReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.DataInputStream;
import java.io.FilenameFilter;

import java.io.FileNotFoundException;
import java.io.IOException;
import javax.swing.UnsupportedLookAndFeelException;

For sure at this part:
private void loadFiles(){
    cesta=folderPicker.getSelectedFile();       
    if(folder==null||loadedCesta!=cesta||(cesta==folderPicker.getSelectedFile()&vetsiPismoVisible==true)){      
    folder=new File(cesta.getName());       

    String datFiles[]=folder.list(new FilenameFilter() {
public boolean accept(File folder, String fileName) {
    return fileName.endsWith(".dat");}});

If I try:
    folder.canRead()
on every folder on my PC and also e.g.on my workstation these new compilations get false as a result. Variable:
    folderPicker
is reffering to JFileChooser that is limited to folders and folders are obtained via actionListener of special JButton (not classic Open and Cancel). You can try it from Karolina_RC.jar from link provided in commentary under conditions said.

A:

Problem solved. For some reason is no longer possible to use only folder name to make File type (folder). Now it is required to use path.
E.g.
File folder=new File(path.getName());
File folder=new File(path.getPath());

Former no longer working. Latter does. I am guessing some JVM-compile issue.

