How to begin learing Java Programming for the Internet?
expecially for socket
Just go to www.google.com and search for java+server+client+socket
And then look at some source code...
Similar Messages
-
Java Program on the Internet -How? Urgent
Hello,
I developed a Mutithread TCPIP socket based Network program "Forex Simulator". It's an applet both from the server side and client side. The Program needs to access the socket as well as Database. The Program is simple. After starting server, many clients can connect and buy and sell currency.
I ran this in my home LAN. Initially, I was having trouble with running applet which rejects socket connection. After searching on the net I modified the Java Run Time Environment java.Policy file and modify permission to connect to my server IP and it works.
I have to upload this program on to internet in a shared server. What should I follow to successfully run this on the net.
There are many java chat program, chart, forex simulator running on the internet. How can I implement my program like that.
Thanking you.
Please please reply me, if someone knows it.Thanks for your comments.
1.- Applets are not server side application but, client side, this means that ALWAYS an applet is downloaded to each client machine and if your "server applet" opens sockets, then every client machine will have its sockets opened but not the web server.
Now I understand what applet really does. My server applet opens socket in my local machine. But I don' want that. I want the program to open the socket on server that means in my case http://webpagedesignpro.com and client will connect to the port of that server.
3.- To create a server on your web server you need to run a stand alone app on the server or use something like J2EE
I badly need to implement my program on the internet. Is there any tutorials or example anywhere for "How to run standalone program on a web server " or J2ee.Standalone means it's not an applet, am I right? As ejp mentioned there is no server applet, so how can I make the serverside program running on a server where client can connect to that server.
Finally, What are the steps of or what is the java technology which can run a chat server on the net where people from all over the world can chat to each other. My program is same as a chat server.
Thanks again. -
How to put a Java Program into the System tray
Hi all of the forum!!
I have a question. I want to make a monitor program but I don't know how to put the program in the system tray or just to execute the program but automatically (no manual execute), but i dont want that the program appear in a window, just start to function when i start my PC. i hope anybody help me.
Thanks
Best Regards
Bucio, FranciscoThere is a plenty of similar topics here, so you can use the Search on this forum or in Google to find out.
But shortly, you will need to use JNI or get a ready-to-use library like JNIWrapper (http://www.jniwrapper.com/winpack.jsp#tray), for example, that lets you do what you want.
Good luck,
EToporov -
How to run a Java program without the command line.
Is there anyway to create a Java program that runs like most programs do in Windows ,by double clicking on their icons?
Thanks,
Vancehttp://www.ej-technologies.com/products/exe4j/overview.html
Looks kinda cool. Most java-2-exe programs are usually way too expensive and wont work with GUIs and require other dlls/libraries... -
How to install a downloaded program from the internet
I downloaded a program (DVD Fab) from the internet and when I try to install it - A box opens up with
text that I can't even read and at the top is says "This fle must be opened with WIN32. Any help will be appreciated. TY----My E-Mail is [email protected]If it doesn't run under CrossOver Mac, you need Windows to use it.
(54330) -
How to run a java program in the JVM of an already running program?
As far as I know about JVM, each time we run a program a separate instance of JVM is created where the program runs. Correct me if I am wrong.
Is there any way for another program to execute itself in the same JVM?
Currently I am working on JFCUnit which is a tool used to automate swing applications. I am trying to automate JConsole.
If I open "JConsole.exe" through a program and then try to get the handles using JFCUnit, things are not working.
If I use JConsole.jar in JDK/lib and create a new instance of JConsole and then try to get the handles using JFCUnit, I am able to proceed with automation.
But here comes the problem :-
The application which needs to be automated through JConsole requires it to be started with few arguments, which is as follows:
%JDK_HOME%\bin\jconsole -J-Djava.class.path=%CLASSPATH% -J-Dcom.sun.management.jmxremote.ssl=false -J-Dcom.sun.management.jmxremote.authenticate=true -J-Djmx.remote.protocol.provider.pkgs=oracle.oc4j.admin.jmx.remote "service:jmx:rmi://localhost:23791"So this problem can be solved in two ways,
Either
1. JFCunit could be made to recognize the JConsole.exe which would be running is a different JVM.
OR
2. JConsole.jar to be used in a way so that it takes the required arguments, hereby an instance of JConsole would be created that too in the same JVM as that of the program.
I am more interested in the first solution as it would definitely be helpful in other projects as well.
Please let me know if any other solution is possible.
Any kinda solution is appreciated :)
Thanks in advance.Give a look at Terracota.
http://www.terracottatech.com/ -
When our Mac was set up we had a password protected startup for FF, so without the password you could not start it.
With the recent upgrade to 6.0 that password request disappeared. How do we get it back?When our Mac was set up we had a password protected startup for FF, so without the password you could not start it.
With the recent upgrade to 6.0 that password request disappeared. How do we get it back? -
Scheidegger Course - Java Language For the Internet
Hi,
I am doing the course mentioned because basically I wanted to improve my job, prospects, etc.
However I have been disapointed with the course and wondered if anyone out there has completed it? If so did it help you improve your career? What is your opinion of it?
I am coming to an end of the study but feel that I do not have enough to offer to get a job involving Java.
Thx.Hi,
The course consists of 11 tutor marked tests (plus a few others they throw in for good measure) and 4 practical days.
If you know nothing about Java (as I did) then the course eases you into it gently ----> and then bang it's get's very complicated. No worry, you have a tutor to phone except mine never seemed to be good at explaining over a phone. These forums are better. The practical tutor is brilliant and is there if you get stuck in class (only mine has a room of 15 pupils and is also teaching everything and anything > eg. Microsoft Word!).
Although I have almost done the course I feel confused about some aspects of Java and know I have only touched the basics. Really all you are doing is reading a text book and sending work off. Practical day you read a html file in a web browser asking you to complete questions. You then code and compile the solution, testing it.
To sum this up: You won't get a job in Java from the course (like they promise)... You won't earn anywhere near what they say. However it's a good way to ease you into the language but don't go expecting a career from it. I plan on buying some books after this is out of the way.
Another option is to buy a book from Amazon.co.uk and teach yourself and ask questions on here. The Scheidegger course is meant to be accredited though.... -
How do i activate a printer for the internet
when I choose print, I get printer not activated, error 02
Please refer the following weblink:
http://h10025.www1.hp.com/ewfrf/wc/document?docname=c00759728&cc=us&dlc=en&lc=en
I am an HP employee.
Regards,
Vidya
Make it easier for other people to find solutions, by marking my answer “Accept as Solution” if it solves your problem.
***Click on "Thumbs up" button to the bottom right side of my post to say thanks!*** -
How to Generate a Java file for a JSP Page
Hi ,
I am using weblogic11 .
I am working on a JSP page which nearly consists of 4000 lines of code.
I need to debug the file , but weblogic server is not generating the java file for the JSP pages .
Please let me know how can i genertae Java file for the jsp pages ??JSPs are compiled into servlets automatically and those classes are stored in WEB-INF/classes folder. Servlet engine handles servlets.
-
The JAVA program for "Philosopher Problem"
When I learn the book of "Operating Systems (Design and Implementation)"(written by Andrew S.Tanenbaum), I try to write a program for the "Philosopher Problem" . In the book there is a sample of this problem in C language, and I write it in JAVA. The following is my program, I have tested it. It is correct, but maybe it is not the most efficient way to solve the problem. Can you think out a more efficient program in JAVA to solve this problem?
* Philosopher Eating Problem
* @author mubin
* @version 1.0
public class PhilosopherEating {
//Philosophers' number
private final static int PHER_NUM = 20;
//Philosophers' state
private volatile static int[] pherState = new int[PHER_NUM];
//THINKING
private final static int THINKING = 0;
//HUNGRY
private final static int HUNGRY = 1;
//EATING
private final static int EATING = 2;
//Philosophers thread group
public static Philosopher[] philosophers = new Philosopher[PHER_NUM];
//finish indicator
public volatile static boolean finished =false;
//thread lock
public static Object threadLock = new Object();
public PhilosopherEating() {
* Philosopher class
* @author mubin
* @version 1.0
public static class Philosopher extends Thread{
int pherNo ;
public Philosopher(int no){
this.pherNo = no;
public void run(){
while(!PhilosopherEating.finished){
think();
takeForks(this.pherNo);
eat();
putForks(this.pherNo);
* Thinking
private void think(){
System.out.println("Philosopher"+this.pherNo+"is thinking...");
try {
Thread.sleep( (int)(Math.random()*100));
}catch (Exception ex) {
ex.printStackTrace(System.out);
* Eating
private void eat(){
System.out.println("Philosopher"+this.pherNo+"is eating...");
try {
Thread.sleep( (int)(Math.random()*100));
}catch (Exception ex) {
ex.printStackTrace(System.out);
* Take the fork
private void takeForks(int no){
//System.out.println("takeForks:no:"+no);
synchronized (threadLock) {
pherState[no] = HUNGRY;
testPher(no);
* Put down the fork
private void putForks(int no){
//System.out.println("putForks:no:"+no);
synchronized (threadLock) {
pherState[no] = THINKING;
if( pherState[getLeft()]==HUNGRY ){
philosophers[getLeft()].interrupt();
if( pherState[getRight()]==HUNGRY ){
philosophers[getRight()].interrupt();
* Return the NO. of philosopher who is sitting at the left side of this philosopher
* @return the NO. of the left philosopher
private int getLeft(){
int ret = (pherNo-1)<0? PHER_NUM-1 : (pherNo-1);
return ret;
* Return the NO. of philosopher who is sitting at the right side of this philosopher
* @return the NO. of the right philosopher
private int getRight(){
int ret = (pherNo+1)>=PHER_NUM ? 0 :(pherNo+1);
return ret;
private void testPher(int no){
while(true){
if(pherState[no]==HUNGRY
&&pherState[getLeft()]!=EATING
&&pherState[getRight()]!=EATING) {
pherState[no] = EATING;
//Print and check the philosophers' state
printPher(pherState);
return;
}else{
try {
System.out.println(" Philosopher "+this.pherNo+"is waiting a fork");
threadLock.wait();
}catch (java.lang.InterruptedException ex) {
System.out.println(" Philosopher "+this.pherNo+"is interrupted and woken up to take fork");
//when it is interrupted, do nothing. Just let it continue!
}//end of while(true)
* Print and check the philosophers' state.
* To insure there are no two philosophers sit side by side
* are eating at the same time.
private static void printPher(int[] phers){
System.out.print(" philosophers' state��");
for (int i = 0; i < phers.length; i++) {
System.out.print(" "+phers);
System.out.println("");
for (int i = 0; i < phers.length-1; i++) {
if (phers[i]==EATING && phers[i+1]==EATING){
System.err.println(i+" and "+(i+1)+"two of philosophers sitted side by side are eating at the same time!");
if (phers[0]==EATING && phers[PHER_NUM-1]==EATING){
System.err.println("0 and "+PHER_NUM+"two of philosophers sitted side by side are eating at the same time!");
public static void main(String[] args) {
for (int i = 0; i < PHER_NUM; i++) {
PhilosopherEating.pherState[i] = THINKING;
PhilosopherEating aPhilosopherEating = new PhilosopherEating();
for (int i = 0; i < PHER_NUM; i++) {
philosophers[i] = new Philosopher(i);
philosophers[i].start();
try {
Thread.sleep(30000);
catch (InterruptedException ex) {
ex.printStackTrace(System.out);
//End all the threads of philosophers
PhilosopherEating.finished = true;this problem is about learning how to use threads/synchronise objects etc, the efficiency of the code isn't really an issue, if that's what you mean. As for the efficiency of the solution, it's very hard to tell how efficient it is, but as long as all the philosphers get to eat there's no problem. I haven't really scrutized your code, but I'm not sure that you have a deadlock free solution: as long as it is possible for all the phils to pick up one fork at the same time there's a problem, and it seems from your code that each philosopher will pick up "his" fork. Again, I could be wrong, I haven't really looked. If you haven't come up with a solution, try drawing it on paper and working it out, or if you're lazy a quick google will probably give you the answer, but I'm pretty sure nobody here will :)
-
How can i apply this java program for a jsp page?
import java.io.*;
import java.util.*;
public class FileProcessing
//create a vector container for the input variables
Vector variables = new Vector();
//create a vector container for the constants
Vector constants = new Vector();
/*create a string expression container for the equation
as read from the file */
String expression = " ";
//create double result container for the final result
double result = 0;
public boolean processFile(String filename,String delim)
//index for values vector
int num_values = 0;
//index for constants vector
int num_constants = 0;
//current line being read from the external file.
String curline = " ";
//start reading from the external file
try
FileReader fr = new FileReader(filename);
BufferedReader br = new BufferedReader(fr);
while(true)
curline = br.readLine();
if(curline == null)
break;
//determine the type of current interaction
boolean variable = curline.startsWith("input");
boolean constant = curline.startsWith("constant");
boolean equation = curline.startsWith("equation");
boolean output = curline.startsWith("result");
//on input variables
if(variable)
StringTokenizer st = new StringTokenizer(curline,delim);
int num = st.countTokens();
int count=0;
while(st.hasMoreTokens())
String temp = st.nextToken();
if(count==1)
byte b[]= new byte[100];
System.out.println(temp);
System.in.read(b);
String inputval = (new String(b)).trim();
variables.add(num_values,inputval);
num_values++;
count++;
// on constant values
if(constant)
StringTokenizer st = new StringTokenizer(curline,delim);
int num = st.countTokens();
int count = 0;
while(st.hasMoreTokens())
String temp = st.nextToken();
if(count==1)
byte b[]= new byte[100];
System.out.println(temp);
System.in.read(b);
String cons = (new String(b)).trim();
constants.add(num_constants,cons);
num_constants++;
count++;
// on equation
if(equation)
StringTokenizer st = new StringTokenizer(curline,delim);
int num = st.countTokens();
int count = 0;
while(st.hasMoreTokens())
String temp = st.nextToken();
if(count==2)
this.expression = temp;
count++;
// now we are ready to evaluate the expression
if(output)
org.nfunk.jep.JEP myparser= new org.nfunk.jep.JEP();
myparser.setAllowAssignment(true);
for(int i=1;i<variables.size()+1;i++)
String name = "arg"+Integer.toString(i);
myparser.addVariable(name,new Double(variables.get(i-1)
.toString()).doubleValue());
for(int i=1;i<constants.size()+1;i++)
String name = "arg" +Integer.
toString(i+variables.size());
myparser.addConstant(name,new Double(constants.get(i-1).toString()));
//output is obtained as follows
myparser.parseExpression(expression);
result = myparser.getValue();
System.out.println("Assay value: "+result);
catch(Exception e)
System.out.println(e.toString());
return true;
public static void main(String[] args)
FileProcessing fp = new FileProcessing();
fp.processFile("input.eqn",":");
}//my text file name is: "input.eqn" (given below)
input:Enter Value1:arg1
input:Enter Value2:arg2
input:Enter Value3:arg3
constant:arg4
constant:arg5
Equation:arg1+arg2+arg3
result:how can i apply this java program for a jsp pagewhy do you want to do this ?
Your program reads from a file on the disk and formats based on a patterm.
Jsp is not intended for such stuff.
ram. -
HOW TO STOP you are opening this program for the first time
I continue to get the warning "you are opening this program for the first time". I don't want that warning to ever appear again for any program. How to permanently get this warning to never again appear?
Best regards,
Steve Schulte
Wednesday 21 November 2012Thomas,
The reason I don't want these warnings (especially for programs that I have had on my Mac for years!) is because I now use ecamm's "Printopia" to send items from my iPad3 running iOS 6.0.1 to my MacBook Pro-13 (mid-2010) running Mountain Lion 10.8.2 -- and in order to do this:
1. Both my iPad and Mac have to be on the same WiFi network.
2. The Mac has to be awake, cannot be in the "sleep" mode
OK but in order to wake my Mac, I've found that using the app "Remote" on my iPad to open iTunes AND PLAY A SONG will "waken" my Mac*.
So now, for example, I send a .jpg file to my Mac. I have it set so that GraphicConverter opens when a .jpg file is to be opened. OK but if this warning appears (and even though I have had GraphicConverter on the Mac since the beginning of time…) I sometimes (like today) get this warning. Of course I am not at my Mac and yet when I eventually go to my Mac-- there is that dialog box sitting there and until I click OK the photo doesn't open (and on my iPad I don't get a confirmation that it has been sent, because it hasn't until I click OK on the Mac).
This could happen for other types of files, too - text files or Word documents etc.
It seems to happen when I UPDATE a program, like when GC went from 8.3 to 8.3.1 for example.
Thanks for any additional comments.
*Perhaps there is a better / faster / easier way to "waken" my Mac from my iPad? This is the only way I have found so far… -
Please Help me How write the BDC program for the MIGO inbound Delivery
Please help me how to write bdc program for the MIGO Inbound Delivery in 4.7EE Version. Please help me.
Not in LSMW. Required call transaction or Session Method. Please help me.
MohanRun transaction BAPI . Select Logistics Execution/Shipping/InboundDelivery/SaveReplica.. You can use function module BAPI_INB_DELIVERY_SAVEREPLICA in your ABAP program.
-
How can I change the default program for the external applications editor?
I have read the on line directions for this and it reads "select a file type in the left pane." I do not see where this is in the left pane. All I see in the left pane is "Browser start pages" and a "How do I " Pane. Nothing with file types.
Hello,
Welcome to Adobe Forums.
In order to change the default program for the external applications editor. Please follow the steps as mentioned below.
Click on Edit menu then choose preferences.
Once the preferences dialog box open.
click on file editors.
On the Left pane you will find all the file types which you want to edit .
On the right hand side you will find the editors for that specific file type.
If you want to add any other application you need to click on + symbol at the top of right pane.
Select the path of that application which you want to apply.
clcik on open.
If you want to make it primay you can click make primary option available at the right hand top. For more detials please check the screenshot below.
Regards,
Rajeev
Maybe you are looking for
-
B2B-51566 Description: Parse stream error with RosettaNet 1.1
Hi Need help with the following error message B2B-51566 Parse stream error We have a trading partner set up to use RosettaNet 1.1 protocol and we are getting 51566 error. We are NOT experiencing this error with a trading partner who is in RosettaNet
-
Is the server down right now. Can't access itunes store to play a movie on my Apple TV.
-
My iPad says that my phone is online, but cannot locate it. why is this?
I have tried to use "find my iphone" on my Ipad, but it just comes up with a message saying that my phone is online, but it cannot locate it. It has done this for a few days now. Can anyone help me out? Thanks
-
Ncmpcpp and using odiaeresis as next_column movement key
Hi! Just started using MPD, and having tried a lot of clients, I ended up settling for ncmpcpp. I have a small problem however. Using i3wm and vim, I have gotten used to controlling any and all movement with keys "o k l ö" (ö is odiaeresis), for up,
-
Clients don't recieve JPG-attachments sent with Yosemite Mail
I am a graphic designer and I used Lokiware's Attachment Tamer prior to Yosemite. Now that the software is not available für this version of mail (and it seems doubtful that it ever will be) I went back to using Mail without it. Ever since, some of m