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());
}
Como extrair chaves TOTP 2FA a partir de QRCODE (Google Authenticator)
Linux em 2025: Segurança prática para o usuário
Desktop Linux em alta: novos apps, distros e privacidade marcam o sábado
IA chega ao desktop e impulsiona produtividade no mundo Linux
Novos apps de produtividade, avanços em IA e distros em ebulição agitam o universo Linux
Digitando underscore com "shift" + "barra de espaços"
Como ativar a lixeira e recuperar aquivos deletados em um servidor Linux
Como mudar o nome de dispositivos Bluetooth via linha de comando
Problema em SSD ao dar boot LinuxMint LMDE FAYE 64 (0)
Baixar jogos Independentes para Ubuntu [RESOLVIDO] (4)
PIP3 - erro ao instalar módulo do mariadb para o Python (1)
Linux x Plataformas de Trading - um problema (in-)solúvel? (4)