Questions tagged [mainclass]

92 questions
1
vote
2 answers

Main class USER and subclass PLAYER, how to PLAYER=USER ? c#

I'm making the first server-client application and i need your help. The client must autenticate itself and after it can play some games. So I've got USER and PLAYER classes: USER comprends all user registered and PLAYER comprends user that play…
Leonardo Rignanese
  • 865
  • 11
  • 22
1
vote
3 answers

How to fix java error?

So I have to create a program where I use polymorphism and inheritance to create arrows that point left and arrow and I did that. however, when I created my main class and try to invoke the methods, say for example "LeftArrow.drawHere" to draw the…
Rocketsm46
  • 21
  • 2
  • 7
1
vote
1 answer

Finding the Main Class

I have my first application written in Netbeans, with supporting libraries. After building the project, the file NetbeansProjects/PDF/dist/PDF.jar runs fine. I'm ultimately trying to build a OSX app, but think(?) that the first step is to bundle the…
Ben Mayo
  • 1,285
  • 2
  • 20
  • 37
0
votes
1 answer

My JOGL program refuses to run what is wrong?

here is my code public class SimpleJoglApp extends JFrame { public static void main(String[] args) { final SimpleJoglApp app = new SimpleJoglApp(); // show what we've done SwingUtilities.invokeLater(new Runnable() { public void…
user1305085
  • 39
  • 2
  • 7
0
votes
2 answers

Could not find or load main class message in netbeans IDE

I setup the Netbeanss 7.1.1 and write the simple code below. But when I run the class, it doesnt work correctly and give this message : Error: Could not find or load main class paket.sss Java Result: 1 package paket; public class sss { public…
ceismail
  • 31
  • 2
  • 5
0
votes
0 answers

Cannot find main classes set while using jframe in netbean

[enter image description here](https://i.stack.imgur.com/ldWe3.png) My netbeans main classes cannot been found when I use jframe, but other than jframe, netbeans can function properly, I really dont know what should what should i do to solve it. I…
0
votes
0 answers

Why am I getting an "Unable to initialize main class" error when running "java -jar Macroffects-0.2.0-SNAPSHOT.jar"?

I have a working java program that I would like to turn into a .jar and eventually a .exe. I am using maven in VS Code on a mac. Initially, I was getting the "no main manifest attribute" error, which I resolved by adding "Main-Class:…
0
votes
1 answer

Call a method from my "MainActivity" in Android

I'm currently messing up with the Google's C2DM notification service. Following the steps in this tutorial: http://www.vogella.de/articles/AndroidCloudToDeviceMessaging/article.html, I succesfully recieved a "push message" from the server. However,…
chntgomez
  • 2,058
  • 3
  • 19
  • 31
0
votes
0 answers

Netbeans cannot find main files in the project

My NetBeans cannot find any main file in the project. This problem occurs only if the main file is inside some package. But due to project specifics, the main file cannot be on the top of the package tree. I tried all advices which I found (clear…
Ján Яabčan
  • 743
  • 2
  • 10
  • 20
0
votes
0 answers

VSCode can't load main class when adding JAR File

I was trying to connect java with MySQL. I downloaded the connector and added it to classpath of the app on Eclipse IDE and also moved to the "Referenced Libraries" on VSCode. Different projects each ones. On Eclipse it worked fine, but VSCode…
Ternes
  • 11
  • 2
0
votes
1 answer

How to put background color white in bootstrap 5?

I need some help to put my background portfolio color in white. I tried to do it by putting a global css but on both sides of the page I have a black background and I can´t change it. return ( <>
0
votes
0 answers

Pass args to a java executable Mac OS Big Sur

Hello I'm learning java and want to pass arguments to main class in a java executable (.jar) in Mac OS Big Sur. Its only an exercise very simple with straight code, for knowledge proposes. The executable works OK in Windows and Unbutu, but I can't…
0
votes
2 answers

Is it bad programming practice to create a static singelton of main class in java?

I am considering using the Singelton Design Pattern and create a Singelton of my Main class. While I was searching, I found some comments that this is rather bad programming practice, especially since the declaration of a static method does not do…
C-lara
  • 115
  • 8
0
votes
1 answer

............ how can i solve it?

I was trying to compile my simple program. But when I want to compile this program : import javax.swing.*; public class First { JFrame f; First(){ f=new JFrame(); String i1 = JOptionPane.showInputDialog(f,"Enter Name"); } …
Y.R
  • 192
  • 1
  • 1
  • 10
0
votes
1 answer

Java "Could not find main class" blah blah blah, but something strange:

So. I compile a .jar file. I know I have the Manifest correct. The main class is called "Boot." Whenever I try to run the .jar, I get the following error: Could not find the main class: .Boot. Program will exit. I have no idea what is…