Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #11903 > unrolled thread

Basic question about compiling

Started bysimplicity <stella_pigeon@live.ca>
First post2012-02-10 08:12 -0800
Last post2012-02-11 02:33 -0800
Articles 10 on this page of 30 — 12 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  Basic question about compiling simplicity <stella_pigeon@live.ca> - 2012-02-10 08:12 -0800
    Re: Basic question about compiling Knute Johnson <nospam@knutejohnson.com> - 2012-02-10 09:00 -0800
      Re: Basic question about compiling Lew <lewbloch@gmail.com> - 2012-02-10 09:29 -0800
        Re: Basic question about compiling simplicity <stella_pigeon@live.ca> - 2012-02-10 11:48 -0800
          Re: Basic question about compiling Lew <lewbloch@gmail.com> - 2012-02-10 13:11 -0800
            Re: Basic question about compiling simplicity <stella_pigeon@live.ca> - 2012-02-11 13:17 -0800
              Re: Basic question about compiling Arne Vajhøj <arne@vajhoej.dk> - 2012-02-11 17:58 -0500
                Re: Basic question about compiling Lew <lewbloch@gmail.com> - 2012-02-11 20:11 -0800
                  Re: Basic question about compiling Arne Vajhøj <arne@vajhoej.dk> - 2012-02-12 09:39 -0500
                Re: Basic question about compiling simplicity <stella_pigeon@live.ca> - 2012-02-11 22:14 -0800
                  Re: Basic question about compiling Leif Roar Moldskred <leifm@dimnakorr.com> - 2012-02-12 00:36 -0600
                    Re: Basic question about compiling Patricia Shanahan <pats@acm.org> - 2012-02-14 06:15 -0800
                  Re: Basic question about compiling Arne Vajhøj <arne@vajhoej.dk> - 2012-02-12 09:37 -0500
                    Re: Basic question about compiling simplicity <stella_pigeon@live.ca> - 2012-02-12 11:04 -0800
                      Re: Basic question about compiling Arne Vajhøj <arne@vajhoej.dk> - 2012-02-12 14:34 -0500
                  Re: Basic question about compiling Jukka Lahtinen <jtfjdehf@hotmail.com.invalid> - 2012-02-14 12:29 +0200
                  Re: Basic question about compiling RedGrittyBrick <RedGrittyBrick@spamweary.invalid> - 2012-02-15 10:38 +0000
          Re: Basic question about compiling rossum <rossum48@coldmail.com> - 2012-02-11 18:57 +0000
          Re: Basic question about compiling Arne Vajhøj <arne@vajhoej.dk> - 2012-02-11 15:14 -0500
            Re: Basic question about compiling simplicity <stella_pigeon@live.ca> - 2012-02-11 12:58 -0800
              Re: Basic question about compiling Arne Vajhøj <arne@vajhoej.dk> - 2012-02-11 16:18 -0500
              Re: Basic question about compiling Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-02-11 18:13 -0400
                Re: Basic question about compiling simplicity <stella_pigeon@live.ca> - 2012-02-11 22:21 -0800
      Re: Basic question about compiling simplicity <stella_pigeon@live.ca> - 2012-02-10 11:26 -0800
        Re: Basic question about compiling Knute Johnson <nospam@knutejohnson.com> - 2012-02-10 11:37 -0800
          Re: Basic question about compiling simplicity <stella_pigeon@live.ca> - 2012-02-10 11:51 -0800
          Re: Basic question about compiling simplicity <stella_pigeon@live.ca> - 2012-02-10 12:30 -0800
            Re: Basic question about compiling Arne Vajhøj <arne@vajhoej.dk> - 2012-02-11 15:00 -0500
          Re: Basic question about compiling Robert Klemme <shortcutter@googlemail.com> - 2012-02-10 23:30 +0100
    Re: Basic question about compiling Roedy Green <see_website@mindprod.com.invalid> - 2012-02-11 02:33 -0800

Page 2 of 2 — ← Prev page 1 [2]


#11950

FromArne Vajhøj <arne@vajhoej.dk>
Date2012-02-11 16:18 -0500
Message-ID<4f36db0f$0$288$14726298@news.sunsite.dk>
In reply to#11948
On 2/11/2012 3:58 PM, simplicity wrote:
> On Feb 11, 1:14 pm, Arne Vajhøj<a...@vajhoej.dk>  wrote:
>> On 2/10/2012 2:48 PM, simplicity wrote:
>>
>>> On Feb 10, 10:29 am, Lew<lewbl...@gmail.com>    wrote:
>>>> You must provide the dependencies *at run-time*.
>>
>>> Didn't I say that I know WHAT is causing it? I thought I did. What I
>>> do not know is WHY and HOW to fix it.
>>
>> If WHY is the question, then you certainly need to study some
>> more Java.
>
> Correct. I am extremely rarely involved in projects requiring Java.
> This one is a one-off prototype to see if our toolkit can integrate
> with a Java in a browser. I did most of it after looking into docs and
> examples from the web: sample applet itself, Java to native interface,
> java policies. Unfortunately I tripped on one of the most trivial
> steps in the project - everything worked fine in Eclipse and
> appletviewer but broke when the same was loaded into a browser.

> BTW, didn't it happen to you that you suddenly got the WHY part after
> someone showed you the HOW aspect?

More times than I can count.

Arne



[toc] | [prev] | [next] | [standalone]


#11951

FromArved Sandstrom <asandstrom3minus1@eastlink.ca>
Date2012-02-11 18:13 -0400
Message-ID<cKBZq.10941$j%3.2014@newsfe04.iad>
In reply to#11948
On 12-02-11 04:58 PM, simplicity wrote:
> On Feb 11, 1:14 pm, Arne Vajhøj <a...@vajhoej.dk> wrote:
>> On 2/10/2012 2:48 PM, simplicity wrote:
>>
>>> On Feb 10, 10:29 am, Lew<lewbl...@gmail.com>  wrote:
>>>> You must provide the dependencies *at run-time*.
>>
>>> Didn't I say that I know WHAT is causing it? I thought I did. What I
>>> do not know is WHY and HOW to fix it.
>>
>> If WHY is the question, then you certainly need to study some
>> more Java.
> 
> Correct. I am extremely rarely involved in projects requiring Java.
> This one is a one-off prototype to see if our toolkit can integrate
> with a Java in a browser. I did most of it after looking into docs and
> examples from the web: sample applet itself, Java to native interface,
> java policies. Unfortunately I tripped on one of the most trivial
> steps in the project - everything worked fine in Eclipse and
> appletviewer but broke when the same was loaded into a browser.
> 
> BTW, didn't it happen to you that you suddenly got the WHY part after
> someone showed you the HOW aspect? It did to me on countless
> occasions. Just as it did in this case... :-).
[ SNIP ]

HOW without the WHY is often legit. In fact you may never need to know
the WHY. That's why we've got dozens upon dozens of domain specialists
in software development. Even an individual who seems to know how to do
everything by themselves - e.g. learns how to configure a new app server
(SSL, LDAP/S, database connections, JMS, clustering, security realms
etc) in a day or less - is probably just someone who has been in the
business long enough that they have become very good at locating,
reading and applying all the HOW material: instruction manuals, online
forums, READMEs and what have you. In a number of areas there may not be
that deep WHY knowledge...and often there doesn't need to be.

Even in teaching situations where the WHY is important, and has to be
communicated, there are many approaches to getting it across. Like you
suggested, with some people you do best in showing them a HOW, and the
they make good progress with the WHY. I know folks like this. Then there
are others, and I know some like this, who do best with WHY instruction,
and only then do they handle the HOW. Most people are a combination of
the two: I learn some things best with a HOW->WHY approach, other things
best with a WHY->HOW approach.

Many of us have built C/C++ executables or libraries from scratch, on
various operating systems. Maybe it's the ./configure, make, make
install sequence, or equivalents in the VS world, doesn't matter. The
point is that most of the time we're not building the executable or
shared library because we have any interest in the source of what we're
building, and often we don't even have the slightest interest in *what*
we're building. We simply need that executable or library on the path to
accomplishing something else productive, and that build process is the
only way to get the correct binary.

Under the circumstances, if halfway through "make" you get a complicated
compile or link error, do you really care about the WHY? Not bloody
likely. If you looked at the README and INSTALL, and they even had a
section specific to your OS there, and you followed the instructions,
that error is an unexpected nuisance. If you're like me you just want to
know HOW to fix it, and couldn't care less about WHY. Off to Google we
go with the exact error, often we're lucky and some dude has a patch
suggestion for obscure.cpp or someone else tells you to tweak a compile
switch for OS version 13.4.2 because the INSTALL docs were for version
13.4.0. And you do it mindlessly, your build and install succeeds, you
often never understood the WHY, and you don't care.

It's possible to get too hung up on the "give a man a fish, teach a man
to fish" idea. Frequently the most productive thing to do, for all
concerned, is just to give the man a fish.

In other spheres of human activity we already know to balance and ration
the HOW and WHY accordingly. We do that both in horizontal and vertical
silos. Why should it be any different in software development?

As far as any given responder is concerned, we all have our strengths.
None of us are good with all the domain areas, nor with all types of
questions. By and large Lew is among the more consistently good
responders in the NG, but he'll be a mismatch for some posters. We all
are from time to time. Best thing to do is suck it up, you'll eventually
get a suitable answer, like this time from Knute. Doesn't mean that the
next time you ask on this group that your best answer won't come from Lew.

AHS
-- 
...wherever the people are well informed they can be trusted with their
own government...
-- Thomas Jefferson, 1789

[toc] | [prev] | [next] | [standalone]


#11965

Fromsimplicity <stella_pigeon@live.ca>
Date2012-02-11 22:21 -0800
Message-ID<d566fa7e-390d-467d-aa66-b6c7456ceef0@ir9g2000pbc.googlegroups.com>
In reply to#11951
On Feb 11, 3:13 pm, Arved Sandstrom <asandstrom3min...@eastlink.ca>
wrote:
> As far as any given responder is concerned, we all have our strengths.
> None of us are good with all the domain areas, nor with all types of
> questions. By and large Lew is among the more consistently good
> responders in the NG, but he'll be a mismatch for some posters. We all
> are from time to time. Best thing to do is suck it up, you'll eventually
> get a suitable answer, like this time from Knute. Doesn't mean that the
> next time you ask on this group that your best answer won't come from Lew.

I get your point. I overreacted a bit, mostly because it was so
different to how I would handle this situation.

Case closed. I wish Lew the best. And if we all can reflect a bit for
the future from this thread... well, I will take a credit for
it :-):-).

[toc] | [prev] | [next] | [standalone]


#11913

Fromsimplicity <stella_pigeon@live.ca>
Date2012-02-10 11:26 -0800
Message-ID<32e4d2ce-fe5c-4f13-b8d2-e659469656ac@18g2000yqe.googlegroups.com>
In reply to#11907
On Feb 10, 10:00 am, Knute Johnson <nos...@knutejohnson.com> wrote:
> On 2/10/2012 8:12 AM, simplicity wrote:
>
>
>
>
>
>
>
>
>
> > I know this is kind of basic but somehow the solution escapes me.
>
> > I have the applet which is supposed to hook up with the hardware
> > attach to the computer. The hook-up interface is available in the
> > external JAR archive called sbsdk.jar. So, I compile the applet with
> > the following command:
>
> > javac -d %DST% ^
> >        -classpath %CLASSPATH_1%;%CLASSPATH_2% ^
> >        %SRC%\MyApplet.java>%DST%\MyApplet.log 2>%DST%\MyApplet.err
>
> > where
> > %CLASSPATH_1% points to the location of the sbsdk.jar, namely "C:\Users
> > \User\\Java\lib\sbsdk.jar"
> > and
> > %CLASSPATH_2% points to "%JRE%\lib\plugin.jar" (for JSObject to
> > communicate with javascript in the page).
>
> > OK, so far so good. Applet compiles with no issues. But that's where
> > it ends. When I load the HTML file containing the applet into a
> > browser I am getting the exception
>
> > Exception in thread "thread applet-MyApplet.class-1"
> > java.lang.NoClassDefFoundError: com.<blah-blah>.sbsdk/SBSDKListener
>
> > Luckily, I have the access to the sbsdk.jar source code.  When I copy
> > the folder structure containing compiled classes of sbsdk (com\<blah-
> > blah>\sbsdk), my applet loads and everything works as expected.
>
> > Can someone help me understand why this is happening? I know that this
> > is generally caused by SBSDKListener class not being available at the
> > run time (while it is available at compile time, hence no build
> > errors) but I do not understand what it means in practical terms.
>
> Do you have an archive statement in your APPLET tag that lists all the
> jar files?
>
> http://docs.oracle.com/javase/1.4.2/docs/guide/misc/applet.html
>
> --
>
> Knute Johnson

I do, but I only specify MyApplet.jar there. Does it mean that I
should have sbsdk.jar added to archive attribute?

How about plugin.jar? Obviously, I do not have the access to its
compiled classes but this one loads without complains. What's the
difference?

[toc] | [prev] | [next] | [standalone]


#11914

FromKnute Johnson <nospam@knutejohnson.com>
Date2012-02-10 11:37 -0800
Message-ID<jh3rlu$ppc$1@dont-email.me>
In reply to#11913
On 2/10/2012 11:26 AM, simplicity wrote:
> I do, but I only specify MyApplet.jar there. Does it mean that I
> should have sbsdk.jar added to archive attribute?

If you are using classes from sbsdk.jar at runtime, you need to include 
that file in the archive statement.

> How about plugin.jar? Obviously, I do not have the access to its
> compiled classes but this one loads without complains. What's the
> difference?

I'm not familiar with what plugin.jar does so I don't know if it would 
be included by some other method.  So I would try including it.

-- 

Knute Johnson

[toc] | [prev] | [next] | [standalone]


#11916

Fromsimplicity <stella_pigeon@live.ca>
Date2012-02-10 11:51 -0800
Message-ID<7b667def-0f7c-4277-9920-ed832f8e5469@18g2000yqe.googlegroups.com>
In reply to#11914
On Feb 10, 12:37 pm, Knute Johnson <nos...@knutejohnson.com> wrote:
> On 2/10/2012 11:26 AM, simplicity wrote:
>
> > I do, but I only specify MyApplet.jar there. Does it mean that I
> > should have sbsdk.jar added to archive attribute?
>
> If you are using classes from sbsdk.jar at runtime, you need to include
> that file in the archive statement.
>
> > How about plugin.jar? Obviously, I do not have the access to its
> > compiled classes but this one loads without complains. What's the
> > difference?
>
> I'm not familiar with what plugin.jar does so I don't know if it would
> be included by some other method.  So I would try including it.

It contains JSObject which provides the interface between the applet
and Javascrip so I can pass the info back and forth between the applet
and the HTML.

Thanks for the hint. I am going to try.

[toc] | [prev] | [next] | [standalone]


#11917

Fromsimplicity <stella_pigeon@live.ca>
Date2012-02-10 12:30 -0800
Message-ID<a839a320-d756-4135-bc38-bd7acb1a0038@c21g2000yqi.googlegroups.com>
In reply to#11914
On Feb 10, 12:37 pm, Knute Johnson <nos...@knutejohnson.com> wrote:
> On 2/10/2012 11:26 AM, simplicity wrote:
>
> > I do, but I only specify MyApplet.jar there. Does it mean that I
> > should have sbsdk.jar added to archive attribute?
>
> If you are using classes from sbsdk.jar at runtime, you need to include
> that file in the archive statement.
>
> > How about plugin.jar? Obviously, I do not have the access to its
> > compiled classes but this one loads without complains. What's the
> > difference?
>
> I'm not familiar with what plugin.jar does so I don't know if it would
> be included by some other method.  So I would try including it.
>
> --
>
> Knute Johnson

Including sbsk.jar in the archive

<applet code="MyApplet.class" archive="MyApplet.jar,sbsdk.jar"
mayscript
        width="700" height="500">
</applet>

works.

For some reason I do not need to spec plugin.jar. Well, this is a
"system" archive so maybe there is a global setting of JVM to link it.
Anyway...

Appreciate your help. Thanks.

[toc] | [prev] | [next] | [standalone]


#11941

FromArne Vajhøj <arne@vajhoej.dk>
Date2012-02-11 15:00 -0500
Message-ID<4f36c8f4$0$294$14726298@news.sunsite.dk>
In reply to#11917
On 2/10/2012 3:30 PM, simplicity wrote:
> On Feb 10, 12:37 pm, Knute Johnson<nos...@knutejohnson.com>  wrote:
>> On 2/10/2012 11:26 AM, simplicity wrote:
>>> I do, but I only specify MyApplet.jar there. Does it mean that I
>>> should have sbsdk.jar added to archive attribute?
>>
>> If you are using classes from sbsdk.jar at runtime, you need to include
>> that file in the archive statement.
>>
>>> How about plugin.jar? Obviously, I do not have the access to its
>>> compiled classes but this one loads without complains. What's the
>>> difference?
>>
>> I'm not familiar with what plugin.jar does so I don't know if it would
>> be included by some other method.  So I would try including it.
>
> Including sbsk.jar in the archive
>
> <applet code="MyApplet.class" archive="MyApplet.jar,sbsdk.jar"
> mayscript
>          width="700" height="500">
> </applet>
>
> works.
>
> For some reason I do not need to spec plugin.jar. Well, this is a
> "system" archive so maybe there is a global setting of JVM to link it.
> Anyway...

The Java browser plugin automatically adds plugin.jar - maybe
not so surprising that a plugin uses plugin.jar.

Arne

[toc] | [prev] | [next] | [standalone]


#11922

FromRobert Klemme <shortcutter@googlemail.com>
Date2012-02-10 23:30 +0100
Message-ID<9plk3sF2rhU2@mid.individual.net>
In reply to#11914
On 10.02.2012 20:37, Knute Johnson wrote:
> On 2/10/2012 11:26 AM, simplicity wrote:
>> I do, but I only specify MyApplet.jar there. Does it mean that I
>> should have sbsdk.jar added to archive attribute?
>
> If you are using classes from sbsdk.jar at runtime, you need to include
> that file in the archive statement.

But that's not the only option.  The Jar's classpath would be another.

Cheers

	robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

[toc] | [prev] | [next] | [standalone]


#11933

FromRoedy Green <see_website@mindprod.com.invalid>
Date2012-02-11 02:33 -0800
Message-ID<5sgcj7pnfevlftdi8b6mjco7edd65sgb64@4ax.com>
In reply to#11903
On Fri, 10 Feb 2012 08:12:07 -0800 (PST), simplicity
<stella_pigeon@live.ca> wrote, quoted or indirectly quoted someone who
said :

>OK, so far so good. Applet compiles with no issues. But that's where
>it ends. When I load the HTML file containing the applet into a
>browser I am getting the exception

You either have to put links to the other jars in your jar, or include
their contents.  The third way to do it is with JNLP that has a
mechanism for specifying extra jars in the *.jnlp file3.

See http://mindprod.com/jgloss/jar.html
http://mindprod.com/jgloss/jarexe.html
http://mindprod.com/jgloss/classpath.html
http://mindprod.com/jgloss/jnlp.html
-- 
Roedy Green Canadian Mind Products
http://mindprod.com
One of the most useful comments you can put in a program is 
"If you change this, remember to change ?XXX? too".
 

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | comp.lang.java.programmer


csiph-web