0

I was coding a small programm in Java. But since the first running an error message in the console occurs: Picked up JAVA_TOOL_OPTIONS: . I read this error message happens due to reaching the RAM limit of Java. But programm is pretty small and I have only one class in package. Maybe you can help me out?

import javax.swing.*;
public class MainClass {

    public static void main(String[] args) {
        try {
        Runtime rt = Runtime.getRuntime();
        rt.exec("cd Downloads");
        } catch (Exception e) {
            JOptionPane a = new JOptionPane();
            a.setMessage("Ein Fehler ist im AutoThemeSwitcher aufgetreten!");
        }
    }

}
Jonathan
  • 87
  • 2
  • 7
  • This is no error, just a message. Simply ignore it, or learn what it means, or follow the advice in the linked question. Just in case, you can have a lokk at https://stackoverflow.com/questions/28327620/difference-between-java-options-java-tool-options-and-java-opts and https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/envvars002.html. – maaartinus Jul 14 '18 at 22:12
  • But there's a different problem with your code: You can't `cd` by executing a program. In Linux, the current working directory is an internal process variable of the shell, which you can change using the build-in `cd` command or by *sourcing* a shell script calling `cd`. `Runtime.exec` starts a new process and the child process has its own working directory . I'm afraid, in Windows, it's about the same. – maaartinus Jul 14 '18 at 22:17

0 Answers0