shanenin Posted May 28, 2006 Author Report Share Posted May 28, 2006 (edited) What package is javac part of? I thought is was part of sun-jdk, but I don't think I have that pachage installed. Is javac part of the runtime? Edited May 28, 2006 by shanenin Quote Link to post Share on other sites
jcl Posted May 28, 2006 Report Share Posted May 28, 2006 It's part of the JDK. Quote Link to post Share on other sites
shanenin Posted May 28, 2006 Author Report Share Posted May 28, 2006 my javac was coming from blackdown-jdk-1.4.2.02. That was causing my confusion. I am installing sun-jdk in its own slot now. Does that also contain the runtime? It should not matter, I already have the runtime installed. Quote Link to post Share on other sites
shanenin Posted May 28, 2006 Author Report Share Posted May 28, 2006 I bet when I emerged azureus the blackdown version of java was installed. Quote Link to post Share on other sites
jcl Posted May 28, 2006 Report Share Posted May 28, 2006 Probably. IIRC it's default JRE/JDK because of Sun's licensing. Quote Link to post Share on other sites
shanenin Posted May 28, 2006 Author Report Share Posted May 28, 2006 I am trying to use java-config to change to the sun-jre-1.5below are the listings of my two java directorysmainbox opt # ls sun-jdk-1.5.0.06/bin/ControlPanel jarsigner javaws jstack native2ascii serialverHtmlConverter java jconsole jstat orbd servertoolappletviewer java-rmi.cgi jdb jstatd pack200 tnameservapt javac jinfo keytool policytoolextcheck javadoc jmap kinit rmicidlj javah jps klist rmidjar javap jsadebugd ktab rmiregistrymainbox opt # ls sun-jre-bin-1.5.0.06/bin/ControlPanel javaws klist pack200 rmiregistryjava keytool ktab policytool servertooljava_vm kinit orbd rmid tnameservwhen I try to set sun-jre-1.5 it gives me an error of not findong javac. Am I suppoed to copy it over from my jdk bin?mainbox opt # java-config --set-system-vm sun-jre-bin-1.5.0.06javac not found at /opt/sun-jre-bin-1.5.0.06/bin/javac or /opt/sun-jre-bin-1.5.0.06/jre/bin/javacjavadoc not found at /opt/sun-jre-bin-1.5.0.06/bin/javadoc or /opt/sun-jre-bin-1.5.0.06/jre/bin/javadocjar not found at /opt/sun-jre-bin-1.5.0.06/bin/jar or /opt/sun-jre-bin-1.5.0.06/jre/bin/jarrmic not found at /opt/sun-jre-bin-1.5.0.06/bin/rmic or /opt/sun-jre-bin-1.5.0.06/jre/bin/rmicTHIS SYSTEM VM IS NOT SUFFICIENT, REQUIRED BINARIES WERE NOT FOUND Quote Link to post Share on other sites
shanenin Posted May 28, 2006 Author Report Share Posted May 28, 2006 (edited) I was studying this simple server/client pairserver# simple illustration client/server pair; client program sends a string# to server, which echoes it back to the client (in multiple copies),# and the latter prints to the screen# this is the serverimport socketimport sys# create a sockets = socket.socket(socket.AF_INET, socket.SOCK_STREAM)# associate the socket with a porthost = '' # can leave this blank on the server sideport = int(sys.argv[1])s.bind((host, port))# accept "call" from clients.listen(1)conn, addr = s.accept()print 'client is at', addr# read string from client (assumed here to be so short that one call to# recv() is enough), and make multiple copies (to show the need for the# "while" loop on the client side)data = conn.recv(1000000)data = 10000 * data# wait for the go-ahead signal from the keyboard (shows that recv() at# the client will block until server sends)z = raw_input()# now sendconn.send(data)# close the connectionconn.close()and now the client# simple illustration client/server pair; client program sends a string# to server, which echoes it back to the client (in multiple copies),# and the latter prints to the screen# this is the clientimport socketimport sys# create a sockets = socket.socket(socket.AF_INET, socket.SOCK_STREAM)# connect to serverhost = sys.argv[1] # server addressport = int(sys.argv[2]) # server ports.connect((host, port))s.send(sys.argv[3]) # send test string# read echoi = 0while(1): data = s.recv(1000000) # read up to 1000000 bytes i += 1 if (i < 5): print data if not data: # if end of data, leave loop break print 'received', len(data), 'bytes'# close the connections.close()from the doc I read, it said the while loop in the client does the followingLines 22ff: The client reads the message from the server. As explained earlier, this is done in a loop, becausethe message is likely to come in chunks. Again, even though Line 35 of the server gave the data to its OS inone piece, the OS may not send it out to the network in one piece, and thus the client must loop, repeatedlycalling recv().That raises the question of how the client will know that it has received the entire message sent by the server.The answer is that recv() will return an empty string when that occurs. And in turn, that will occur whenthe server executes close() on Line 38I am not understaning what this part of the loop is doingi += 1 if (i < 5):It seems to be causing it only to print only the first 5 loops, is that nessesary to getting the whole string sent. The code seems useless(that is why i thnk I am not understanding it) Edited May 28, 2006 by shanenin Quote Link to post Share on other sites
naraku9333 Posted May 28, 2006 Report Share Posted May 28, 2006 I am trying to use java-config to change to the sun-jre-1.5below are the listings of my two java directorysmainbox opt # ls sun-jdk-1.5.0.06/bin/ControlPanel jarsigner javaws jstack native2ascii serialverHtmlConverter java jconsole jstat orbd servertoolappletviewer java-rmi.cgi jdb jstatd pack200 tnameservapt javac jinfo keytool policytoolextcheck javadoc jmap kinit rmicidlj javah jps klist rmidjar javap jsadebugd ktab rmiregistrymainbox opt # ls sun-jre-bin-1.5.0.06/bin/ControlPanel javaws klist pack200 rmiregistryjava keytool ktab policytool servertooljava_vm kinit orbd rmid tnameservwhen I try to set sun-jre-1.5 it gives me an error of not findong javac. Am I suppoed to copy it over from my jdk bin?mainbox opt # java-config --set-system-vm sun-jre-bin-1.5.0.06javac not found at /opt/sun-jre-bin-1.5.0.06/bin/javac or /opt/sun-jre-bin-1.5.0.06/jre/bin/javacjavadoc not found at /opt/sun-jre-bin-1.5.0.06/bin/javadoc or /opt/sun-jre-bin-1.5.0.06/jre/bin/javadocjar not found at /opt/sun-jre-bin-1.5.0.06/bin/jar or /opt/sun-jre-bin-1.5.0.06/jre/bin/jarrmic not found at /opt/sun-jre-bin-1.5.0.06/bin/rmic or /opt/sun-jre-bin-1.5.0.06/jre/bin/rmicTHIS SYSTEM VM IS NOT SUFFICIENT, REQUIRED BINARIES WERE NOT FOUNDI have my jdk set as default, the jre doesn't include javac, but the jdk includes the jre. Quote Link to post Share on other sites
naraku9333 Posted May 28, 2006 Report Share Posted May 28, 2006 I bet when I emerged azureus the blackdown version of java was installed.For future reference azureus doesn't build with a 1.5 jdk so you will have to revert to blackdown to re-build it if necessary. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.