Enviado em 15/04/2021 - 22:36h
O meu código em java por algum motivo para no if ou no else do ifString home = System.getenv("HOME");
JOptionPane.showMessageDialog(null, "Programa rodando");
try {
FileReader arq = new FileReader(home + "/Documentos/.economy-game/log-exists.txt");
BufferedReader lerArq = new BufferedReader(arq);
String linha = lerArq.readLine();
JOptionPane.showMessageDialog(null, linha);
if (linha.equals("true")) {
JOptionPane.showMessageDialog(null, "Economy-game has started!");
}
else {
Scanner scan = new Scanner(System.in);
String nick;
System.out.println("Enter your nickname:");
nick = scan.nextLine();
System.out.println("Your new nick is " + nick);
Path dir = Paths.get(home + "/Documentos/.economy-game/my-nick.txt");
byte[] nickbyte = nick.getBytes();
try {
Files.write(dir, nickbyte);
} catch(Exception erro) {
System.out.printf("Erro: %s");
}
String LogBln = "true";
Path LogExistsDir = Paths.get(home + "/Documentos/.economy-game/log-exists.txt");
byte[] LogBlnByte = LogBln.getBytes();
try {
Files.write(LogExistsDir, LogBlnByte);
} catch(Exception erro) {
System.out.println("Erro: %s");
}
scan.close();
}
JOptionPane.showMessageDialog(null,"fora do if");
arq.close();
} catch (IOException e) {
System.err.printf("Erro na identificação do log: %s.\n",
e.getMessage());
}
Aprenda a Gerenciar Permissões de Arquivos no Linux
Como transformar um áudio em vídeo com efeito de forma de onda (wave form)
Como aprovar Pull Requests em seu repositório Github via linha de comando
Visualizar arquivos em formato markdown (ex.: README.md) pelo terminal
Dando - teoricamente - um gás no Gnome-Shell do Arch Linux
Como instalar o Google Cloud CLI no Ubuntu/Debian
Mantenha seu Sistema Leve e Rápido com a Limpeza do APT!
Procurando vídeos de YouTube pelo terminal e assistindo via mpv (2025)
Sinto uma leve lentidão ao arrastar, miniminizar e restauras as janela... (3)
Alguém já usou o framework Avalonia para desenvolver interfaces de usu... (4)
Ajuda Pra Melhoria do NFTABLES. (8)
Pastas da raiz foram para a área de trabalho [RESOLVIDO] (7)