Thread: Run.bat error

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1 Run.bat error 
    Registered Member
    Join Date
    Jul 2010
    Posts
    81
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    I am getting this error when i try to run the server

    Code:
    Exception in thread "main" java.lang.NoClassDefFoundError: server
    Caused by: java.lang.ClassNotFoundException: server
            at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    Could not find the main class: server.  Program will exit.
    Press any key to continue . . .
    I know the error says it can't find server.class, but I DO have run.bat and server.class in the same folder

    inside run.bat:

    Code:
    @echo off
    Title DavidScape 508
    "C:\Program Files\Java\jdk1.6.0_21\bin\java.exe" Server 43594
    pause


    and yes.. i can Compile..



    What's wrong?
    Reply With Quote  
     

  2. #2  
    Registered Member
    Nuevo's Avatar
    Join Date
    Jul 2008
    Posts
    647
    Thanks given
    7
    Thanks received
    13
    Rep Power
    169
    Its in the server.java file that has an error. Check the main method
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Jul 2010
    Posts
    81
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    No.. I don't think so.. Because i can compile..
    anyways here's what's inside Server.java

    EDIT: I also tried another source and gives me the same error.. Looks like its happening to me with new versions only like 474+

    Code:
    package DavidScape;
    
    
    import java.io.*;
    import DavidScape.net.SocketListener;
    import DavidScape.players.PlayerSave;
    import DavidScape.util.Misc;
    import DavidScape.ClanChat.ClanMain;
    import DavidScape.ClanChat.SaveChats;
    import DavidScape.ClanChat.ClanList;
    import DavidScape.ClanChat.inChat;
    import DavidScape.world.mapdata.MapData;
    
    public class Server {
    
        /**
         * The engine used to update almost everything, such as players, items, and NPCs.
         */
    public static ClanMain ClanMain = new ClanMain();
     public static SaveChats SaveChats;
        public static Engine engine;
        /**
         * Listens for incoming connections and accepts them.
         */
        public static SocketListener socketListener;
    
        /**
         * Save character files.
         */
        private static PlayerSave playerSave;
    
        /**
         * Banned accounts list.
         */
        public static String[] bannedUsers = new String[1000];
    
        /**
         * Main method for running the server.
         * <p>While specifying port 0 will select a random open port, it is not suggested as
         * you will not be informed on what port was selected. If you pick a port already
         * in use, the server will shut down.
         * @param args The port to run the server on, or 0 for a random port.
         */
    public static MapData mapData = null;
        public static void main(String[] args) {
            try {
                socketListener = new SocketListener(Integer.parseInt(args[0]));
            } catch (Exception e) {
    
                /*
                 * If this happens then the specified port is most likely already in use.
                 */
                e.printStackTrace();
                return;
            }
    mapData = new MapData();
            mapData.loadRegions();
            loadBannedUsers();
            engine = new Engine();
            //playerSave = new PlayerSave();
            socketListener.run();
    	ClanMain.loadChats();
    	SaveChats = new SaveChats();
        }
    
        /**
         * Loads all banned users at startup.
         */
        public static void loadBannedUsers() {
            int index = 0;
    
            try {
                BufferedReader in = new BufferedReader(
                        new FileReader("./data/banned/bannedusers.dat"));
                String loggedUser = null;
    
                while ((loggedUser = in.readLine()) != null) {
                    bannedUsers[index] = loggedUser;
                    index++;
                }
            } catch (Exception e) {
                Misc.println("Error loading banned users list.");
            }
        }
    }
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Jul 2010
    Posts
    81
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    Bump
    anyone know? i have 317 which works but i don't like it because NPC not clipping, too bad i found that after i worked 1 week on the server

    why im not able to run new version of rs servers?
    Reply With Quote  
     

  5. #5  
    Donator

    Arithium's Avatar
    Join Date
    May 2010
    Age
    31
    Posts
    4,721
    Thanks given
    199
    Thanks received
    1,256
    Rep Power
    1114
    maybe you should update your java? and this section is for 317 not 503+. but do you have a 64-bit computer?
    Reply With Quote  
     

  6. #6  
    Registered Member Sheddy's Avatar
    Join Date
    Jul 2009
    Age
    31
    Posts
    1,053
    Thanks given
    56
    Thanks received
    89
    Rep Power
    69
    No clue if this will fix but try this:

    Code:
    @echo off
    Title DavidScape 508
    "C:\Program Files\Java\jdk1.6.0_21\bin\java.exe" -Xmx512m Server 43594
    pause
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Jul 2010
    Posts
    81
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    No it didn't work
    I have 32 bit Windows Vista Home Premium
    and my JDK is jdk1.6.0_21
    Reply With Quote  
     

  8. #8  
    Donator

    Arithium's Avatar
    Join Date
    May 2010
    Age
    31
    Posts
    4,721
    Thanks given
    199
    Thanks received
    1,256
    Rep Power
    1114
    Try

    @echo off
    Title DavidScape 508
    java -Xmx512m Server 43594
    pause

    or

    @echo off
    Title DavidScape 508
    "C:\Program Files\Java\jre6\bin\java.exe" -Xmx512m Server 43594
    pause
    Reply With Quote  
     

  9. #9  
    Registered Member
    Join Date
    Jul 2010
    Posts
    81
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    I found the solution
    to everyone who has this problem: you need to set your environment variables
    Reply With Quote  
     

  10. #10  
    Respected Member


    kLeptO's Avatar
    Join Date
    Dec 2006
    Age
    28
    Posts
    2,955
    Thanks given
    1,183
    Thanks received
    754
    Rep Power
    3084
    It's java problem.
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •