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());
}
Desktop Linux ganha fôlego enquanto distros refinam experiência e segurança
Wayland em alta, IA em debate e novos ventos para distros e devices
Qt 6.10 e Python 3.14 puxam o ritmo do software livre nesta quarta
Atualizações de Apps, Desktop e Kernel agitam o ecossistema Linux nesta terça-feira
Como mudar o nome de dispositivos Bluetooth via linha de comando
Adicionando o repositório backports no Debian 13 Trixie
Não tenho som no meu Kali linux (0)
Erro ao fazer remaster usando Penguin eggs (2)
Primeiras impressões do Debian 13 (25)
Meu Amigo não consegue entrar em meu mundo, via tailscale, hamachi e z... (1)