comp.lang.java.programmer
http://groups-beta.google.com/group/comp.lang.java.programmer
[EMAIL PROTECTED]

Today's topics:

* NIO using - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f3f26d7d2ff77c3d
* FINE,FINER,FINEST - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/efcb60cb9f83bb19
* Applet and clickable text/label - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/fc30d97d8f00da14
* Jboss4.0.0 startup error message - 2 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5382989b63641d2b
* webapplication does not display tiff images - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ac1ffc6aa73a2d74
* How to minumize a image's size created by java.awt.BufferedImage? - 2 
messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d12451141358c411
* opinion on coding standard - 3 messages, 3 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1f96751a1d317c1a
* JDBC Resource Ref from various webapp init methods - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9ca7198f74cc0744
* classgen.jar - old version? - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ff65b1f0e6b52a71
* Best Java Profiler? - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a0ac5813a0001f52
* character literals and string - 3 messages, 3 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e44b7024c6d130d6
* Java Career Questions - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b2c43e3a96c2d70e
* Compiling java code from within Java - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7dccb8de6fe57263
* Telling the truth at interviews for Java positions - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b3bba249c109316a
* executable JARs, Solaris execev() and java version - 4 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5e6c18c60d4376fe
* JBoss to go closed source? - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4a8dda54906ca8df
* Problem with adding a JFreeChart into a PDF document - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/db888a6bcc3040db
  
==========================================================================
TOPIC: NIO using
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f3f26d7d2ff77c3d
==========================================================================

== 1 of 1 ==
Date:   Tues,   Nov 23 2004 10:16 pm
From: Sudsy <[EMAIL PROTECTED]> 

Alexey Dmitriev wrote:
> Hi, all..
> 
> How you think, in what problems it is necessary to use NIO?

You'd do well to read up on the origins of the select call in UNIX.
Rather than spawning off a separate thread to handle each incoming
connection, you can have what is effectively a multiplexer which can
monitor activity on multiple channels. A single thread can coordinate
the operation of a scalable system with less overhead.

Start here:
<http://www.calpoly.edu/cgi-bin/man-cgi?select>

Then compare to the docs on the Sun site here:
<http://java.sun.com/developer/technicalArticles/releases/nio/>

This is a situation where borrowing from C makes sense, IMHO. I'm
not happy with the incorporation of C++ prototypes into Java 1.5
(or Java 5, depending on your preference) however. YMMV.

-- 
Java/J2EE/JSP/Struts/Tiles/C/UNIX consulting and remote development.





==========================================================================
TOPIC: FINE,FINER,FINEST
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/efcb60cb9f83bb19
==========================================================================

== 1 of 2 ==
Date:   Tues,   Nov 23 2004 10:20 pm
From: "Daniel Parker" <[EMAIL PROTECTED]> 

On Windows XP, JDK 1.4.2_06, I'm getting the following results:

Logger logger = Logger.getLogger(this.getClass().getName(),null);

logger.setLevel(Level.INFO);
logger.getLevel() -> returns INFO
logger.info(message); -> prints message

logger.setLevel(Level.FINE);
logger.getLevel() -> returns FINE
logger.fine(message); -> doesn't print anything

logger.setLevel(Level.FINER);
logger.getLevel() -> returns FINER
logger.fine(message); -> doesn't print anything

logger.setLevel(Level.ALL);
logger.getLevel() -> returns ALL
logger.fine(message); -> doesn't print anything

Basically, SEVERE, WARNING, and INFO work as expected, but FINE, FINER and
FINEST don't seem to work at all.  Does anyone have any idea what is going
on?  I couldn't find anything with google.

Regards,
Daniel Parker





== 2 of 2 ==
Date:   Tues,   Nov 23 2004 11:44 pm
From: "Filip Larsen" <[EMAIL PROTECTED]> 

Daniel Parker wrote

> Basically, SEVERE, WARNING, and INFO work as expected, but FINE, FINER
and
> FINEST don't seem to work at all.  Does anyone have any idea what is
going
> on?  I couldn't find anything with google.

You need to set the level on each Handler you want to deliver the log
record. In this case you probably want to set the level on the
ConsoleHandler, which per default is set to print only INFO and above.
Edit your <JRE Home>/lib/logging.properties file to set it differently
is one way to do it.

Since the logging system is rather flexible I recommend that you visit
http://java.sun.com/j2se/1.5.0/docs/guide/logging/overview.html if you
haven't already.


Regards,
-- 
Filip Larsen






==========================================================================
TOPIC: Applet and clickable text/label
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/fc30d97d8f00da14
==========================================================================

== 1 of 1 ==
Date:   Tues,   Nov 23 2004 10:42 pm
From: Andrew Thompson <[EMAIL PROTECTED]> 

On 23 Nov 2004 14:57:55 -0800, Oscar wrote:

> I'm trying to write an applet ..

<http://www.physci.org/codes/javafaq.jsp#appfirst>, closely followed by
<http://www.physci.org/codes/javafaq.jsp#cljg>

>.. and I want some text to be clickable. I
> don't know if it is possible but I want it to look like normal
> huperlinks but act like buttons. 

<http://www.cs.uu.nl/wais/html/na-dir/computer-lang/java/gui/faq.html> 
Q 6.5.2

HTH

-- 
Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.LensEscapes.com/  Images that escape the mundane




==========================================================================
TOPIC: Jboss4.0.0 startup error message
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5382989b63641d2b
==========================================================================

== 1 of 2 ==
Date:   Tues,   Nov 23 2004 11:02 pm
From: JScoobyCed <[EMAIL PROTECTED]> 

Hi,

        I have just installed JBoss 4.0.0 on WinXP SP2, J2SE 1.4.2_05.
It's installation directory is d:\java\jboss (there is no space in the name)
When I start JBoss, I have the "normal" error messages, and at the end I 
have a nasty ClassDefNotFoundException about 
org/jboss/.../AspectManager.class

I do not need to use AOP, but it seems it is needed by the default jboss 
environment.
What should I do ? I have triied to install the JBoss AOP 1.0.0 Final 
(just unzip in a folder) and put the .jar in the Jboss/lib folder. 
Doesn't work.
I have followed a wiki page advice to remove the jboss-aop-deployer and 
replace it by the AOP version, no success...

Thanks for help.

Cedric



== 2 of 2 ==
Date:   Wed,   Nov 24 2004 12:10 am
From: JScoobyCed <[EMAIL PROTECTED]> 

JScoobyCed wrote:
> Hi,
> 
>     I have just installed JBoss 4.0.0 on WinXP SP2, J2SE 1.4.2_05.
> It's installation directory is d:\java\jboss (there is no space in the 
> name)
> When I start JBoss, I have the "normal" error messages, and at the end I 
> have a nasty ClassDefNotFoundException about 
> org/jboss/.../AspectManager.class
> 
> I do not need to use AOP, but it seems it is needed by the default jboss 
> environment.
> What should I do ? I have triied to install the JBoss AOP 1.0.0 Final 
> (just unzip in a folder) and put the .jar in the Jboss/lib folder. 
> Doesn't work.
> I have followed a wiki page advice to remove the jboss-aop-deployer and 
> replace it by the AOP version, no success...
> 
> Thanks for help.
> 
> Cedric

Ok I found it. I have to run in standard mode.

Cedric




==========================================================================
TOPIC: webapplication does not display tiff images
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ac1ffc6aa73a2d74
==========================================================================

== 1 of 1 ==
Date:   Tues,   Nov 23 2004 11:41 pm
From: [EMAIL PROTECTED] (bauer) 

"Ann" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>...
> "bauer" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Hi,
> > I wrote a small web-application that displays tif images that are
> > retrieved from a database. I use Tomcat "4.1.24-LE-jdk14" as
> > web-container on a windows XP system and AlternaTiff as Tif Viewer
> > plugin for IE. The application works fine. But now I want to move to a
> > unix box where I use Tomcat "4.1.31". If I execute the same request on
> > the unix system the image is not displayed anymore but I see a
> > question dialog box asking me if I want to save or open the file. If I
> > choose open the binary file is opened in a text editor. I really don't
> > know why. If I choose save and save the file as NNN.tif I can view it
> > with as tif viewer-> means the raw data is ok. The only difference I
> > saw (when I used axis Tcp Tunnel Monitor for monitoring the request
> > datastream) is the response Header from Tomcat
> >
> 
> Nice to see you repeating your question, maybe I should repeat mine.
> Did you move AlternaTiff too?


AlternaTiff is a client browser pluginto display tiff images in the
browser. This means that each client has to install this (or some
similar) pulgin. On my test client it is installed.




==========================================================================
TOPIC: How to minumize a image's size created by java.awt.BufferedImage?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d12451141358c411
==========================================================================

== 1 of 2 ==
Date:   Tues,   Nov 23 2004 11:44 pm
From: "MaoXuePeng" <[EMAIL PROTECTED]> 

Hi, everyone:
I want to create a image conform 'PNG' format by
java.awt.image.BufferedImage class. So, which color type is best for
minumize the image's size and still with a proper quality?? 


I tried two color types. When used BufferedImage.TYPE_INT_RGB, the image
is too large! But There is nothing in the image except the black
background when used BufferedImage.TYPE_USHORT_555_RGB as the color type
in the constructor! What's Wrong???

Thanks.
MaoXuePeng.




== 2 of 2 ==
Date:   Wed,   Nov 24 2004 12:17 am
From: Andrew Thompson <[EMAIL PROTECTED]> 

On Wed, 24 Nov 2004 02:44:00 -0500, MaoXuePeng wrote:

> I want to create a image conform 'PNG' format 

Why .png?  (Rather than .jpg, for instance)

>..by
> java.awt.image.BufferedImage class. So, which color type is best for
> minumize the image's size and still with a proper quality?? 

a 1x1 image with 1 color is smaller, but you really have
not described your images well enough to make further comment.

How big are they (WxH)?  What original colur depth?  Are they
images of the real world (plants, landscapes, people), or more
machines, structures, technical images.. or are they the more
'cartoon' style images with a limited number of colors?

> I tried two color types. When used BufferedImage.TYPE_INT_RGB, the image
> is too large! 

How big is 'too large'?

>..But There is nothing in the image except the black
> background when used BufferedImage.TYPE_USHORT_555_RGB as the color type
> in the constructor! What's Wrong???

More information required.

*Maybe* (note the maybe) an SSCCE can help answer most 
of the questions above.
<http://www.physci.org/codes/sscce.jsp>

-- 
Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.LensEscapes.com/  Images that escape the mundane




==========================================================================
TOPIC: opinion on coding standard
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1f96751a1d317c1a
==========================================================================

== 1 of 3 ==
Date:   Wed,   Nov 24 2004 12:32 am
From: "sks" <[EMAIL PROTECTED]> 


"Michael Borgwardt" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> sks wrote:
> >>The worst of all is the requirement to have hard tab characters in
source
> >>files - if someone asks me to do that I just find another job.
> >
> >
> > I think using multiple spaces instead of tabs is completely ridiculous.
>
> Then you're thinking wrongly or misunderstood the subject. We're talking
> about *source code*. That means, text files that are frequently changed,
> by different people, often using different editors, and where correct
> indentation is very important for understanding the code.
>
> The problem is that people have different settings for how "wide" a tab
> is, and then, as soon as tabs and spaces get mixed (which invariably
> happens) the formatting is broken for some people.

I know precisely what he means and by using tabs its automatically formatted
how I like it. I like 3 spaces per ident level because it looks right with
my font, you might like 200. If you use spaces I'm just going to get pissed
when looking at your code and vice versa.






== 2 of 3 ==
Date:   Wed,   Nov 24 2004 12:45 am
From: Michael Borgwardt <[EMAIL PROTECTED]> 

sks wrote:
>>The problem is that people have different settings for how "wide" a tab
>>is, and then, as soon as tabs and spaces get mixed (which invariably
>>happens) the formatting is broken for some people.
> 
> 
> I know precisely what he means

Apparently not.

> and by using tabs its automatically formatted
> how I like it. I like 3 spaces per ident level because it looks right with
> my font, you might like 200. If you use spaces I'm just going to get pissed
> when looking at your code and vice versa.

Again: this only works when you use *only* tabs, but that never works because
you *can't see the difference* between tabs only and mixed tabs&spaces. They
inevitably become mixed and then the formatting is totally screwed at a 
different
tab width.



== 3 of 3 ==
Date:   Wed,   Nov 24 2004 3:39 am
From: "Chris Uppal" <[EMAIL PROTECTED]> 

Ann wrote:

> Don't be such a baby.

All you are saying is that /you/ don't care about code layout.  Yet other
people
/do/ care.  Maybe that isn't how you want the world to be, but that's the way
it is, and that's the way it'd going to stay.

So stop whining and get over it.

    -- chris







==========================================================================
TOPIC: JDBC Resource Ref from various webapp init methods
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9ca7198f74cc0744
==========================================================================

== 1 of 1 ==
Date:   Wed,   Nov 24 2004 12:54 am
From: [EMAIL PROTECTED] (0ssk0) 

Hello

Web Server : Sun One Web Server 6.1

I want to do some DB activity using JDBC Conn Pool resource ref during
webapp startup.

I tried putting the code in

- contextInitialized()
- filter init()
- servlet init()

None of them worked. Even though the code is executed, its unable to
fetch the JDBC Conn Pool ref since the ref is getting initialzied only
after these init methods are executed.

Any workarounds? Is there a way to make Resource Ref to initialize
first?

thanks
ssk




==========================================================================
TOPIC: classgen.jar - old version?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ff65b1f0e6b52a71
==========================================================================

== 1 of 1 ==
Date:   Wed,   Nov 24 2004 1:07 am
From: "Andy Carson" <[EMAIL PROTECTED]> 

I'm trying to compile the snippet of code available from
http://www.oracle.com/technology//tech/xml/info/htdocs/otnwp/about_oracle_xml_products.htm
that's available below.

My problem is that the generator.generate(dtd, doctype_name); requires the
dtd to be of type oracle.xml.parser.v2.DTD whilst my dtd obviously is of
type oracle.xml.parser.DTD. Is there and old version of the
classgen.jar-file that supports the oracle.xml.parser.DTD type?

import java.io.*;
import java.net.*;

import oracle.xml.parser.*;
import oracle.xml.classgen.*;
import org.w3c.dom.Element;
import org.w3c.dom.DocumentType;
(...)

  public static void main (String args[])
  {
    String dtdFile = "MyFile.dtd";
    String rootName = "CompanyQuery";
    try    {
      XMLParser parser = new XMLParser();
      XMLDocument doc = parser.getDocument();
      DocumentType type = doc.getDoctype();
      NamedNodeMap nodeMap = type.getAttributes();
      DTD dtd = (DTD) type;
      String doctype_name = null;

      doctype_name = doc.getDocumentElement().getTagName();
      ClassGenerator generator = new ClassGenerator();
      generator.setGenerateComments(true);
      generator.setOutputDirectory(".");
      generator.setValidationMode(true);

      generator.generate(dtd, doctype_name);
    }
    catch (...){...}






==========================================================================
TOPIC: Best Java Profiler?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a0ac5813a0001f52
==========================================================================

== 1 of 1 ==
Date:   Wed,   Nov 24 2004 1:17 am
From: Aleksander Straczek <[EMAIL PROTECTED]> 

Chris wrote:

> I'm looking for a cheap or free profiler for use within the Eclipse
> environment. I used to use Eclipse Profiler, but it hasn't been updated in a
> while and it doesn't work correctly with Eclipse 3.0. Any suggestions?
Try http://www.eclipse.org/hyades.

-- 
HTH, Alex




==========================================================================
TOPIC: character literals and string
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e44b7024c6d130d6
==========================================================================

== 1 of 3 ==
Date:   Wed,   Nov 24 2004 1:43 am
From: "VisionSet" <[EMAIL PROTECTED]> 

"Pete Elmgreen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi all,
>
> I've got a newbie question - I tried different things but can't get the
syntax right
> This is what need to do: concatenate character literals (hex value) and a
string
>
>    String s;
>    s = '\x0b' + "my string" + '\x1C' + '\x0D'  ;
>
> Compiler says illegal token "\" will be ignored (twice)
>
> How can I fix this

String s = Integer.toHexString(0xFF) + " myString ";

\x is not a valid escape character
'?' where ? is a single valid character
'\u0123' is valid unicode character since 0x0123 is valid hex value for a
unicode character
valid escape characters are
\f formfeed
\n newline
\r carriage return\b backspace
\t tab
\u unicode hex value follows
\' literal '
\" literal "
\\ literal \


-- 
Mike W






== 2 of 3 ==
Date:   Wed,   Nov 24 2004 1:52 am
From: Michael Borgwardt <[EMAIL PROTECTED]> 

Pete Elmgreen wrote:
> I've got a newbie question - I tried different things but can't get the 
> syntax right
> This is what need to do: concatenate character literals (hex value) and a 
> string
>    
>    String s;
>    s = '\x0b' + "my string" + '\x1C' + '\x0D'  ;
> 
> Compiler says illegal token "\" will be ignored (twice)

Character literals can be specified in four ways:

'a'      (actual character literal)
'\141'   (octal numerical escape)
'\u0061' (unicode escape)
'\n'     (special escape sequence)

Note that unicode escapes are processed before the code is parsed, so
they should not be used for control characters (especially linefeed
and carriage return).

Also, character literals are of type char and thus are integer types.
Attempting to concatenate two chars with + will result in their
numerical values to be added.

Better use a StringBuffer in such cases.



== 3 of 3 ==
Date:   Wed,   Nov 24 2004 1:13 am
From: [EMAIL PROTECTED] (Pete Elmgreen) 

Hi all, 

I've got a newbie question - I tried different things but can't get the syntax 
right
This is what need to do: concatenate character literals (hex value) and a string
   
   String s;
   s = '\x0b' + "my string" + '\x1C' + '\x0D'  ;

Compiler says illegal token "\" will be ignored (twice)

How can I fix this

TIA
Pete




==========================================================================
TOPIC: Java Career Questions
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b2c43e3a96c2d70e
==========================================================================

== 1 of 1 ==
Date:   Wed,   Nov 24 2004 2:31 am
From: "Chris Uppal" <[EMAIL PROTECTED]> 

J.Storta wrote:

> 1)  What, if any, IDE do you use?  NetBeans?  Eclipse?  Other?

Doesn't matter a damn.


> 2)  What do you spend most of your time doing?  Debugging existing
> code?  Writing new code?

By preference, writing (and testing, and debugging) new code.  Modifying and
debugging old code takes more time though.  And my best estimate is that around
50-60% of my actual working time (not in meetings etc) has been spent doing
documentation (the "downside" of the fact I've been lucky in often getting new
systems to design/work on).


> 3)  Aside from the knowing the language itself, what would you say is
> the most important skill to have as a Java Developer?

In no special order:

    - a good memory.
    - the ability to talk to and listen to other people -- /in their terms/.
    - the ability to read other people's code and work our what the hell they
      were trying to express.
    - the ability to search for information, and willingness to take the time
      to absorb it.
    - a nitpicking attitude to "doing it right".

None of these are Java-specific.

Other posters heave mentioned "good solid OO principles", and I agree
(strongly).

(One added, somewhat tongue-in-cheek, "in other words [...] learn
Smalltalk first" -- which I'd also agree with, but add the rider that learning
Smalltalk second is still /far/ better than not learning it at all.  Oddly,
another reason to learn Smalltalk is nothing to do with OO at all: the
"white-box" style of Smalltalk libraries and frameworks (as opposed to the
black box style popular amongst Java programmers) means that you get a /lot/
of practice at reading and inferring the underlying design of other people's
code -- which is a critically important skill for any programmer, and (IMO) one
of the hardest to learn.)

Getting some familiarity with so-called "design patterns" will help too (btw
this has /nothing/ to do with OO programming -- although the two are sometimes
confused).  It will help quite lot for a small input of effort.

BTW.  If you were looking for an answer like "learn Swing" or "learn J2EE" or
something, then I'm sorry to disappoint you.  I don't think that learning a
/specific/ library or application domain really counts for much.  It may help
you get jobs because people will want programmers who don't need to be taught
Swing/XML/etc before they can be productive, but it doesn't make you a better
/programmer/ in itself.  If you'll accept a slightly snobbish
over-generalisation: "Good programmers measure themselves by what they could
do, bad programmers measure themselves by what they know".  Judging from the
other replies, the other respondents feel that general skills matter more than
specifics too.

(But, that said, I suspect that wherever and whatever you end up doing, it's
likely that you'll need to understand the basics of SQL databases, networking,
and XML -- not in detail, and certainly not to expert level, but just enough to
understand what people are talking about, and do simple tasks without help -- 
so those are areas worth looking at.)

    -- chris






==========================================================================
TOPIC: Compiling java code from within Java
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7dccb8de6fe57263
==========================================================================

== 1 of 1 ==
Date:   Wed,   Nov 24 2004 2:33 am
From: "Chris Uppal" <[EMAIL PROTECTED]> 

Michael Borgwardt wrote:

> [snipped]

Agreed, on all three counts.

    -- chris






==========================================================================
TOPIC: Telling the truth at interviews for Java positions
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b3bba249c109316a
==========================================================================

== 1 of 1 ==
Date:   Wed,   Nov 24 2004 3:04 am
From: "Chris Uppal" <[EMAIL PROTECTED]> 

Chris Smith wrote:

> [...] so if I told you I wanted a senior
> developer, it would just mean that I didn't want to train someone up to
> a productive level on the job.  It would not necessarily mean that I
> have inherently difficult tasks that I need someone to perform.

But would you think it fair not to make that clear at interview ?  In
particular wouldn't you want to ensure that /you/ understood what the candidate
was expecting to get out of the job, and that you were in a position to supply
it ?

    -- chris







==========================================================================
TOPIC: executable JARs, Solaris execev() and java version
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5e6c18c60d4376fe
==========================================================================

== 1 of 4 ==
Date:   Wed,   Nov 24 2004 3:14 am
From: James Lee <[EMAIL PROTECTED]> 

For test I have made a trivial Java program that prints the java version
and directory from the System properties:

public class JavaTest
{
        public static void main(String[] argv)
        {
                System.out.println(System.getProperty("java.home"));
                System.out.println(System.getProperty("java.version");
        }
}

I compile it with a low version of javac to ensure compatibility with many
JVMs:
$ PATH=/usr/java1.1/bin:$PATH javac JavaTest.java

Make the executable jar:
$ echo 'Main-Class: JavaTest' > manifest
$ jar cmf manifest JavaTest JavaTest.class
$ chmod +x JavaTest

When I execute it using the java command it uses the JVM of the first
java on the PATH - exactly as expected:
$ java JavaTest
/opt/jdk1.5.0/jre
1.5.0

The JVM is also confirmed by:
$ java -version
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64) Java
HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)

When I execute the jar I get what I expect:
$ ./JavaTest
/opt/jdk1.5.0/jre
1.5.0


If I change the PATH so another JVM is first I get unexpected results:

$ PATH=/usr/java1.2/bin:$PATH java -version
java version "1.2.2"
Solaris VM (build Solaris_JDK_1.2.2_10, native threads, sunwjit)

$ PATH=/usr/java1.2/bin:$PATH java JavaTest
/usr/java1.2/jre
1.2.2

$ PATH=/usr/java1.1/bin:$PATH java -version
java version "1.1.8"

$ PATH=/usr/java1.2/bin:$PATH ./JavaTest
/opt/jdk1.5.0/jre
1.5.0

$ PATH=/usr/java1.1/bin:$PATH ./JavaTest
/opt/jdk1.5.0/jre
1.5.0


With another machine:
$ java -version
java version "1.4.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01) Java
HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)

$ ./JavaTest
/usr/java1.2/jre
1.2.2

If I compile with java v1.5 it still execs an old version which duly fails.

"truss -ef ./JavaTest" shows that it is execve(2) executing the jar file,
it also shows the PATH active for execve, but in choosing a JVM execve is
not using the PATH.

Finally the question:  How does execve decide which JVM to use when
executing a jar file?





== 2 of 4 ==
Date:   Wed,   Nov 24 2004 3:26 am
From: James Lee <[EMAIL PROTECTED]> 

Pardon me, I'll try the same again, hopefully with out the @#$% wrap "feature"
of the newsreader...


For test I have made a trivial Java program that prints the java version
and directory from the System properties:

public class JavaTest
{
        public static void main(String[] argv) {
                System.out.println(System.getProperty("java.home"));
                System.out.println(System.getProperty("java.version");
        }
}

I compile it with a low version of javac to ensure compatibility with
many JVMs:
$ PATH=/usr/java1.1/bin:$PATH javac JavaTest.java

Make the executable jar:
$ echo 'Main-Class: JavaTest' manifest
$ jar cmf manifest JavaTest JavaTest.class
$ chmod +x JavaTest

When I execute it using the java command it uses the JVM of the first java
on the PATH - exactly as expected:
$ java JavaTest
/opt/jdk1.5.0/jre
1.5.0

The JVM is also confirmed by:
$ java -version
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64) Java
HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)


When I execute the jar I get what I expect:
$ ./JavaTest
/opt/jdk1.5.0/jre
1.5.0


If I change the PATH so another JVM is first I get unexpected results:

$ PATH=/usr/java1.2/bin:$PATH java -version java
version "1.2.2"
Solaris VM (build Solaris_JDK_1.2.2_10, native threads, sunwjit)

$ PATH=/usr/java1.2/bin:$PATH java JavaTest
/usr/java1.2/jre
1.2.2

$ PATH=/usr/java1.1/bin:$PATH java -version
java version "1.1.8"

$ PATH=/usr/java1.2/bin:$PATH ./JavaTest
/opt/jdk1.5.0/jre
1.5.0

$ PATH=/usr/java1.1/bin:$PATH ./JavaTest
/opt/jdk1.5.0/jre
1.5.0


With another machine:
$ java -version
java version "1.4.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01) Java
HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)

$ ./JavaTest
/usr/java1.2/jre
1.2.2

If I compile with java v1.5 it still execs an old version which duly
fails.

"truss -ef ./JavaTest" shows that it is execve(2) executing the jar file,
it also shows the PATH active for execve, but in choosing a JVM execve is
not using the PATH.

Finally the question:  How does execve decide which JVM to use when
executing a jar file?




== 3 of 4 ==
Date:   Wed,   Nov 24 2004 3:29 am
From: James Lee <[EMAIL PROTECTED]> 

On Wed, 24 Nov 2004 11:26:18 +0000, James Lee wrote:

> Pardon me, I'll try the same again, hopefully with out the @#$% wrap
> "feature" of the newsreader...

...I give up!




== 4 of 4 ==
Date:   Wed,   Nov 24 2004 3:31 am
From: Drazen Kacar <[EMAIL PROTECTED]> 

James Lee wrote:

>  Finally the question:  How does execve decide which JVM to use when
>  executing a jar file?

I think it just executes /usr/java/bin/java and ignores PATH completely.
So JVM selection is controlled with /usr/java symlink.

-- 
 .-.   .-.    Yes, I am an agent of Satan, but my duties are largely
(_  \ /  _)   ceremonial.
     |
     |        [EMAIL PROTECTED]




==========================================================================
TOPIC: JBoss to go closed source?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4a8dda54906ca8df
==========================================================================

== 1 of 1 ==
Date:   Wed,   Nov 24 2004 3:29 am
From: Tim Tyler <[EMAIL PROTECTED]> 

In comp.lang.java.advocacy Cindi Jenkins <[EMAIL PROTECTED]> wrote or quoted:

> > You might want to explain how anyone can "steal" the intellectual 
> > property in a LGPL project - without breaking copyright law.
> 
> It is simple, all JBoss has to do is change the licensing for the
> next version...

You mean JBoss can steal their /own/ intellectual property - if they all 
agree to it?

I can't see how that would be theft - the IP is already theirs.
-- 
__________
 |im |yler  http://timtyler.org/  [EMAIL PROTECTED]  Remove lock to reply.




==========================================================================
TOPIC: Problem with adding a JFreeChart into a PDF document
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/db888a6bcc3040db
==========================================================================

== 1 of 1 ==
Date:   Wed,   Nov 24 2004 12:59 am
From: [EMAIL PROTECTED] (Grand Paradis) 

I would like to add a JFreeChart into a PDF document, using jfreechart
and itext libraries, but my chart isn't clean. When I add it into an
HTML page, it's beautiful, but into a PDF it's very ugly (text of
title and categories is too big and not thin enough)

Here is my code :

private void writeChart (JFreeChart chart, int width, int height,
PdfContentByte cb) {
                        
                PdfTemplate tp = cb.createTemplate(width, height);
                Graphics2D g2 = tp.createGraphics(width, height, new
DefaultFontMapper());
                Rectangle2D r2 = new Rectangle2D.Double(0, 0, width, height);
                chart.draw(g2, r2);
                g2.dispose();
                cb.addTemplate(tp, 100, 550);
}
        
Do you know what I should do?

Thanks



=======================================================================

You received this message because you are subscribed to the
Google Groups "comp.lang.java.programmer".  

comp.lang.java.programmer
[EMAIL PROTECTED]

Change your subscription type & other preferences:
* click http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe

Report abuse:
* send email explaining the problem to [EMAIL PROTECTED]

Unsubscribe:
* click http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe


=======================================================================
Google Groups: http://groups-beta.google.com 

Reply via email to