Garmaine Staff asked 2 years ago

Im getting >>> /Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home/bin/java Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" java.lang.SecurityException: Prohibited package name: java.streams

package java.streams;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

public class WritingFiles {
  public static void main(String[] args) throws IOException {

    // Stream Connectivity
    File file =
        new File("/Users/qasim_lp/Downloads/LearnJava/src/main/resources/myTextFileCreated.txt");
    FileWriter fileWriter = new FileWriter(file);
    BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);

    // Writing inside the file
    bufferedWriter.write("First Line");
    bufferedWriter.newLine();
    bufferedWriter.write("Test");

    // Closing the stream
    bufferedWriter.close();
  }
}

Any help? 🙂