LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
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: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
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
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766

Original Poster
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
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: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
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
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766

Original Poster
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
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: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
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
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766

Original Poster
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
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



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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:36 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration