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());
}
Deixando o Gnome bonitão em qualquer distribuição
Como ativar o módulo de cancelamento de ruído no Pipewire
Como escolher o melhor escalonador de CPU para melhorar o desempenho da máquina
Curiosidade sobre DOOM Guy e Isabelle de Animal Crossing
Inicializando servidor Ubuntu na AWS e rodando apache em Container
Checar seu IP externo no terminal
Como fazer um pendrive butável dar boot no VirtualBox
GRUB do Debian 12 não detecta segundo Linux instalado em partição BTRF... (30)
Convertendo valores em bytes maiores que 1YB[DUVIDA] (4)
executar arquivo como programa pelo terminal linux ubuntu (6)