Thread: Eclipse when running the server/client

Page 1 of 2 12 LastLast
Results 1 to 10 of 19
  1. #1 Eclipse when running the server/client 
    Registered Member
    Join Date
    Apr 2013
    Posts
    50
    Thanks given
    2
    Thanks received
    1
    Rep Power
    11
    EDIT:

    I have located a SERVER.java file in a package called "redone". So in the initiate.bat file it contains this:
    @[Only registered and activated users can see links. ] off
    java -Xmx256m -cp bin;libs\*; server.Server
    pause

    So i changed it to the package it was located in:
    @[Only registered and activated users can see links. ] off
    java -Xmx256m -cp bin;libs\*; redone.Server
    pause

    However, still getting the same error now.


    EDIT: I tried with the new changes opening the bats outside of eclipse and it worked. WTF is wrong with eclipse?

    Thanks, appreciate all the help.
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Feb 2010
    Posts
    3,187
    Thanks given
    1,124
    Thanks received
    834
    Discord
    View profile
    Rep Power
    1514
    there are two issues at play here

    firstly the issue you are having is called the classpath.

    every java program has a main method and you have to tell java where that main method is

    Code:
     java -cp bin server.Server
    (not the real path just an example)

    the above tells java to look for the class path in the bin folder and to search the package server for the class called Server which contains our main method

    eclipse automates this process but you need to use the gui to tell it where the main method is still otherwise it's clueless.

    your second issue is that rs is a multiplayer game played over a network, this is easier to manage using what's called a client-server model. every user has a client that interfaces with the server(s).

    edit: with your edit my second point is not needed but I will keep it anyway.
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Apr 2013
    Posts
    50
    Thanks given
    2
    Thanks received
    1
    Rep Power
    11
    Quote Originally Posted by Fire Cape View Post

    eclipse automates this process but you need to use the gui to tell it where the main method is still otherwise it's clueless.
    Thanks for the reply.

    I understood that the server.java was located in redone package. I changed the initiate.bat. However, like you have just mentioned, how do we "tell" eclipse where it is? I assumed that having the redone.server as the path would do that automatically.
    Reply With Quote  
     

  4. #4  
    Registered Member

    Join Date
    Feb 2010
    Posts
    3,187
    Thanks given
    1,124
    Thanks received
    834
    Discord
    View profile
    Rep Power
    1514
    here is the thing: eclipse does not know about the path in the .bat file.

    .bat is windows specific extension

    eclipse handles this separately, I haven't used it in a while but it should be in Run -> Run configurations, there should be an option to select the main class
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Apr 2013
    Posts
    50
    Thanks given
    2
    Thanks received
    1
    Rep Power
    11
    Quote Originally Posted by Fire Cape View Post
    here is the thing: eclipse does not know about the path in the .bat file.

    .bat is windows specific extension

    eclipse handles this separately, I haven't used it in a while but it should be in Run -> Run configurations, there should be an option to select the main class
    I did this:

    (not sure why image isnt showing but main class was changed to "redone.Server"

    It now at least prints out in the terminal but there is a lot of errors like so:


    Code:
    item.cfg: file not found.
    java.io.FileNotFoundException: .\data\cfg\prices.txt (The system cannot find the path specified)
    	at java.io.FileInputStream.open0(Native Method)
    	at java.io.FileInputStream.open(Unknown Source)
    	at java.io.FileInputStream.<init>(Unknown Source)
    	at java.util.Scanner.<init>(Unknown Source)
    	at redone.world.ItemHandler.loadItemPrices(ItemHandler.java:339)
    	at redone.world.ItemHandler.<init>(ItemHandler.java:36)
    	at redone.Server.<clinit>(Server.java:63)
    ./Data/CFG/npc.cfg: file not found.
    ./Data/CFG/spawn-config.cfg: file not found.
    Reply With Quote  
     

  6. #6  
    Registered Member

    Join Date
    Feb 2010
    Posts
    3,187
    Thanks given
    1,124
    Thanks received
    834
    Discord
    View profile
    Rep Power
    1514
    Quote Originally Posted by gilbo184 View Post
    I did this:

    (not sure why image isnt showing but main class was changed to "redone.Server"

    It now at least prints out in the terminal but there is a lot of errors like so:


    Code:
    item.cfg: file not found.
    java.io.FileNotFoundException: .\data\cfg\prices.txt (The system cannot find the path specified)
    	at java.io.FileInputStream.open0(Native Method)
    	at java.io.FileInputStream.open(Unknown Source)
    	at java.io.FileInputStream.<init>(Unknown Source)
    	at java.util.Scanner.<init>(Unknown Source)
    	at redone.world.ItemHandler.loadItemPrices(ItemHandler.java:339)
    	at redone.world.ItemHandler.<init>(ItemHandler.java:36)
    	at redone.Server.<clinit>(Server.java:63)
    ./Data/CFG/npc.cfg: file not found.
    ./Data/CFG/spawn-config.cfg: file not found.
    Yes that is working now.

    The server has tried to start but has not been able to locate the config files correctly.

    First you need to see if the issue is that the path is incorrect, check if there is actually a data/cfg/prices.txt for example.

    Note I'm not talking about the classpath here but the path to the configuration files.

    Just a note folder names might be case sensitive so

    Code:
     data/cfg
    Code:
    Data/CFG
    Aren't always the same thing.

    You're on Windows so it probably isn't an issue but something to keep in mind.
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Apr 2013
    Posts
    50
    Thanks given
    2
    Thanks received
    1
    Rep Power
    11
    Quote Originally Posted by Fire Cape View Post
    Yes that is working now.

    The server has tried to start but has not been able to locate the config files correctly.

    First you need to see if the issue is that the path is incorrect, check if there is actually a data/cfg/prices.txt for example.

    Note I'm not talking about the classpath here but the path to the configuration files.

    Just a note folder names might be case sensitive so

    Code:
     data/cfg
    Code:
    Data/CFG
    Aren't always the same thing.

    Thanks, the path is correct i.e. ./data/cfg/prices.txt so not sure why its not finding. prices.txt is there and is all lower case.

    So this is for getting the server going. When i try to run other bat files. for example client folder that contains run.bat, it says

    "The system cannot find the path specified.
    Error: Could not find or load main class Main"

    I tried configuring to Main, but that changes the server bat file too when i dont want to,
    Reply With Quote  
     

  8. #8  
    Registered Member

    Join Date
    Feb 2010
    Posts
    3,187
    Thanks given
    1,124
    Thanks received
    834
    Discord
    View profile
    Rep Power
    1514
    Does it find when running from the .bat ? Could be eclipse has not included the data folder in the project correctly.
    Reply With Quote  
     

  9. #9  
    Registered Member
    Join Date
    Apr 2013
    Posts
    50
    Thanks given
    2
    Thanks received
    1
    Rep Power
    11
    Quote Originally Posted by Fire Cape View Post
    Does it find when running from the .bat ? Could be eclipse has not included the data folder in the project correctly.
    nah.

    So I have these folders:

    2006redone Client:
    compile.bat
    run.bat

    2006redone file_Server:
    start.cmd

    2006redone Server:
    build.bat
    initiate.bat

    When i run initiate.bat the error is the same. SO i tried running build.bat and i get "Error: Unable to access jarfile libs/javac++.jar"
    Reply With Quote  
     

  10. #10  
    Registered Member

    Join Date
    Feb 2010
    Posts
    3,187
    Thanks given
    1,124
    Thanks received
    834
    Discord
    View profile
    Rep Power
    1514
    Quote Originally Posted by gilbo184 View Post
    Thanks, the path is correct i.e. ./data/cfg/prices.txt so not sure why its not finding. prices.txt is there and is all lower case.

    So this is for getting the server going. When i try to run other bat files. for example client folder that contains run.bat, it says

    "The system cannot find the path specified.
    Error: Could not find or load main class Main"

    I tried configuring to Main, but that changes the server bat file too when i dont want to,
    Editing the client run.bat will not change the server run.bat. The client classpath will be different though.
    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

Similar Threads

  1. error when running the server
    By jcor9 in forum Help
    Replies: 3
    Last Post: 11-07-2015, 07:09 PM
  2. Replies: 3
    Last Post: 10-25-2015, 10:54 PM
  3. some error when I run the server [paying 3$]
    By Norcotic in forum Buying
    Replies: 1
    Last Post: 01-31-2012, 05:52 AM
  4. Wierd error:S When i run the server
    By Mergim in forum Help
    Replies: 4
    Last Post: 10-25-2009, 11:20 PM
  5. Replies: 2
    Last Post: 08-30-2009, 03:57 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •