Results 1 to 5 of 5
- 04-07-2012, 01:30 AM #1
Member
- Join Date
- Apr 2012
- Posts
- 5
- Rep Power
- 0
Running a UDPServer on cmd window
I have tried to make a UDPServer and complied it. Howver, it doesn't run while another file, DisplayIP.class works.
It casts the error like the picture below. So i thought, it might be a problem with my pahtes, yet, it still doesn't work.
How can i fix this?
JAVA_HOME:
C:\Program Files\Java\jdk1.7.0_03
CLASSPATH:
.;%JAVA_HOME%\lib\tools.jar
path:
;%JAVA_HOME%\bin
- 04-07-2012, 02:18 AM #2
Re: Running a UDPServer on cmd window
To copy the contents of the command prompt window:
Click on Icon in upper left corner
Select Edit
Select 'Select All' - The selection will show
Click in upper left again
Select Edit and click 'Copy'
Paste here.
Is the class in a package? Remove the package statement for easier testing. Otherwise position the class file to reflect the package and include the package name with the class name with the java command.If you don't understand my response, don't ignore it, ask a question.
- 04-07-2012, 02:34 AM #3
Re: Running a UDPServer on cmd window
You need to be in the folder that contains the UDP folder. The java command will follow the package path to find the class file.command? ex)java UDP.UDPServerIf you don't understand my response, don't ignore it, ask a question.
- 04-07-2012, 02:44 AM #4
Member
- Join Date
- Apr 2012
- Posts
- 5
- Rep Power
- 0
Re: Running a UDPServer on cmd window
Um.. I opened the command window in UDP folder which is package. and I typed like following:
---------------------------------------------------
C:\Users\Hongyun\workspace\MyDemo5\src\UDP>java UDP.UDPServer 1234
Error: Could not find or load main class UDP.UDPServer
C:\Users\Hongyun\workspace\MyDemo5\src\UDP>
-------------------------------------------------------
FYI, 1234 stands for the port number setting.
Of course my source starts with "package UDP;"
- 04-07-2012, 02:48 AM #5
Member
- Join Date
- Apr 2012
- Posts
- 5
- Rep Power
- 0
Similar Threads
-
Closing secondary window from button in primary window
By KoncentriK in forum New To JavaReplies: 4Last Post: 02-26-2012, 01:24 AM -
Problem running Applet in IE but works when running just Java in Netbeans?
By rodneyc8063 in forum Java AppletsReplies: 7Last Post: 12-18-2011, 04:13 AM -
how to disable the parent window when child window is open
By ayushi in forum Java ServletReplies: 1Last Post: 07-25-2011, 10:24 AM -
Need to pass a value from a parent window to a pop up or child window
By blackpanther in forum Advanced JavaReplies: 4Last Post: 01-10-2010, 07:48 AM -
change url in parent window from child window
By rakesh_n_mehta in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 07-09-2009, 12:17 PM


1Likes
LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks