LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 04-27-2009, 05:31 AM   #1
Thor_2.0
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,204
Blog Entries: 23

Rep: Reputation: 279Reputation: 279Reputation: 279
Question Switching Java JDK - impact???


Hi,

I'm using F10 with the Java that came with it. And I'm stuck at something. I am devving an applet, served by a LAN server, the applet does a feedback tru the sys console

Quote:
System.out.println("some stuff");
It seems the IcedTea does'nt even have such a console where I can read the feedback, someone suggested getting rid of the IcedTea and installing the standard Sun JDK - what impact would that have on my machine?

I tried log4j, but it depresses me :-( , and I also tried Java's own logger, it makes a logfile, but the applet (ran from the browser) does'nt write to it - security, of course...

Tnx

Thor
(extra specs of my project available, just ask)
 
Old 04-27-2009, 05:40 AM   #2
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453
I am not at all a Java guy, by why can't you write your diagnostic output to a file rather than to STDOUT, and then from any terminal do

Code:
less diagnostic_output.log
?

Ot Java applets can't write to files directly, just to STDOUT/STDERR ?
 
Old 04-27-2009, 05:50 AM   #3
Thor_2.0
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,204
Blog Entries: 23

Original Poster
Rep: Reputation: 279Reputation: 279Reputation: 279
Hmm,

Lemme give that a "whack"...

In fact, I was settled to the idea of having to read a file (using log4j?) or Java's own logger mech, but, as you aplty dotted out: applets cant do that.

Ok, I can see the security holes in windows if and when a System.out CAN actually be read on the console, but Linux just HAS to have some other mechanism...

As said, I'll have a close look at youe suggestions...thanks!

Thor
 
Old 04-27-2009, 06:38 AM   #4
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453
Quote:
Originally Posted by linusr@flanders View Post
Hmm,

Lemme give that a "whack"...

In fact, I was settled to the idea of having to read a file (using log4j?) or Java's own logger mech, but, as you aplty dotted out: applets cant do that.

Ok, I can see the security holes in windows if and when a System.out CAN actually be read on the console, but Linux just HAS to have some other mechanism...

As said, I'll have a close look at youe suggestions...thanks!

Thor
Well, if your applet can write to socket - it's trivial to set up socket listener (server) in Perl, but I do not know how simple is to set up socket writer in Java.

I.e. I mean to send diagnostic output to socket.
 
Old 04-27-2009, 04:41 PM   #5
Thor_2.0
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,204
Blog Entries: 23

Original Poster
Rep: Reputation: 279Reputation: 279Reputation: 279
Hey, there is a thought! And I mean just that! The very idea, why not write a "thingie" in Perl, listening to the socket the applet sends to/tru/over?

Let me think "out loud" for a moment (it's 23:39 here, I just came out of the shower, just got back from work - so I'm not very lucid anymore ...)

I'd write a little "void" (a function that does'nt give a value back) in Java that accepts a string, that void would write to a socket (never even attempted this before) that has a listener - on the same machine - in the shape of a Perl script. So every time I get an error (try/catch construct for example) I'd send the error message to the void-to the socket- to the Perl script- to a console.

Can Perl do that (duh - my Perl knowledge is next-to-non-existend, so sorry about the question)???

Hey, and I REALLY mean that, big thanks!!!

Thor
(having a little more hope again)
 
Old 04-27-2009, 05:25 PM   #6
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453
Quote:
Originally Posted by linusr@flanders View Post
Hey, there is a thought! And I mean just that! The very idea, why not write a "thingie" in Perl, listening to the socket the applet sends to/tru/over?

Let me think "out loud" for a moment (it's 23:39 here, I just came out of the shower, just got back from work - so I'm not very lucid anymore ...)

I'd write a little "void" (a function that does'nt give a value back) in Java that accepts a string, that void would write to a socket (never even attempted this before) that has a listener - on the same machine - in the shape of a Perl script. So every time I get an error (try/catch construct for example) I'd send the error message to the void-to the socket- to the Perl script- to a console.

Can Perl do that (duh - my Perl knowledge is next-to-non-existend, so sorry about the question)???

Hey, and I REALLY mean that, big thanks!!!

Thor
(having a little more hope again)
Of course, it can. Here is a short tutorial:

http://www.perlfect.com/articles/sockets.shtml
.

Or/and enter

Perl socket tutorial
Perl socket programming

, etc. into your favorite WEB search engine.
 
Old 04-29-2009, 04:33 AM   #7
Thor_2.0
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,204
Blog Entries: 23

Original Poster
Rep: Reputation: 279Reputation: 279Reputation: 279
So, this really works...now I have to figure out how to let this work in a browser. I've tried it in the IDE (appletviewer) and there it works perfectly, in a browser, I get an "applet not initialized"...
Security? Dunnow-yet...

The tutorial helped. I'll send all the debug messages tru a socket, and read them in a nearby console...

Again, thanks!

Thor
 
  


Reply

Tags
alternate, applet, java, jdk, logging


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Java JDK idgeitman Linux - Newbie 4 01-21-2010 02:53 PM
Help installing the Java JDK CS_Student_DrewU Programming 2 07-14-2007 10:43 PM
LXer: Open Source Impact on Software Innovation Outweighs Impact on ... LXer Syndicated Linux News 0 08-15-2006 01:54 PM
compile java JDK 1.4 kernelvn *BSD 2 06-21-2005 09:42 PM
adding java jdk to path snecklifter Linux - Newbie 4 11-01-2004 02:58 PM


All times are GMT -5. The time now is 03:07 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration