Relative Content

Tag Archive for javaeclipse

How do I make a probability between two numbers?

I tried to make a number randomization system for my text game, but I want to make it so that there are more than two probabilities, like if(rand.nextInt(100) <= 25, and after that I would put something like this, if(rand .nextInt(100) >= 26 && <= 75, however eclipse says that I cannot use && in a Boolean code or int code and also tells me to delete the <=, how do I do something like that without giving an error?

How to fix this persistent Eclipse IDE java error

Error: Could not find or load main class Unit2.ReadNames2 Caused by: java.lang.ClassNotFoundException: Unit2.ReadNames2 The above error is produced every single time I try to run any of my (newer or recently edited) class in any of my Java projects on my Eclispe IDE. But what confuses me even more is that if I try to […]

Eclipse crashes as soon as I try to do something (Ubuntu)

This morning I’ve installed Java SDK on my Ubuntu (version 23.10) machine, tried it with some classes writte in text editor and decided to download Eclipse.
However, after installing it from the Ubuntu “App Center” and starting it I noticed that as soon as I tried to write the main method to do the usual hello world print for testing, it crashed: it made me make the project, the package,the class; but as I wrote the dot in “System.” it crashed generating a log file like “hs_err_pid4182.log”.
I’ve tried installing other Eclipse versions (from the official site like 2023-09, 2023-03, 2024-03) but nothing and the same happens with different versions of Java.
Then I tried not to create my own project but to press on the “Build Hello World app” in the Eclipse menu (when you start it up) and it crashes…