-1

I have the same version of JDK on my laptop and my desktop. My laptop is Windows 7 and my desktop is Windows XP. When I run my game on the desktop, it says cannot find or load main class client. When I run it on my laptop it finds it. I have the versions for java and jdk 1.7u4 set up correctly for each computer. And when I compile the game, I have errors on the desktop that I don't get on the laptop. I would post my code, but I know it's not a coding error, because it works on one computer, yet not the other one. I've checked all details a million times, even tried fixing the random false errors I get from compiling, but have had no progress. I don't want to always have to edit my game client off of my laptop because I host the game on my desktop. If anyone has had this problem before, please tell me how you solved it. If you've had it but can't solve it, at least let me know I'm not the only one this has happened to. I can't find any solutions with Google, and I've even tried using a different version of JDK.(1.7u1) So, if it's not java, it's not my game, it has to be my computer. What could cause my computer to act like this towards my game. And other things compile fine, it's just my game client that doesn't compile. So then again, would it be something about my game, even though it works on my laptop and use to work on my desktop?? This is so confusing.

In case it is because of my client, and now that I read over the compiler a few times again, it may be. So here are the errors:

.\Javafiles\MP3.java:5: error: package javazoom.jl.player does not exist
import javazoom.jl.player.Player;
                         ^
.\Javafiles\MID.java:5: error: package javazoom.jl.player does not exist
import javazoom.jl.player.Player;
                         ^
.\Javafiles\MP3.java:20: error: cannot find symbol
        player.close();
              ^
  symbol:   method close()
  location: variable player of type Player
.\Javafiles\MP3.java:32: error: constructor Player in class Player cannot be app
lied to given types;
            player = new Player(bis);
                     ^
  required: no arguments
  found: BufferedInputStream
  reason: actual and formal argument lists differ in length
.\Javafiles\MP3.java:42: error: cannot find symbol
                try { player.play(); }
                            ^
  symbol:   method play()
  location: variable player of type Player
.\Javafiles\MID.java:18: error: cannot find symbol
    public void close() { if (player != null) player.close(); }
                                                    ^
  symbol:   method close()
  location: variable player of type Player
.\Javafiles\MID.java:27: error: constructor Player in class Player cannot be app
lied to given types;
            player = new Player(bis);
                     ^
  required: no arguments
  found: BufferedInputStream
  reason: actual and formal argument lists differ in length
.\Javafiles\MID.java:37: error: cannot find symbol
                try { player.play(); }
                            ^
  symbol:   method play()
  location: variable player of type Player
Note: .\Javafiles\client.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
8 errors
Press any key to continue . . .
Alex Benoit
  • 21
  • 1
  • 6

1 Answers1

0

The compiler complains that it can't find the required class javazoom.jl.player.Player on the classpath. There must be a difference in the way you compile the application on the two different machines.

Don't look at different operating systems or Java SDK versions. Check the build process. Verify that you have the required library on both machines and the classpaths point to that jar file.

Further Reading

Community
  • 1
  • 1
Andreas Dolk
  • 113,398
  • 19
  • 180
  • 268