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


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

my java is broken !

Started bybilsch <king621@comcast.net>
First post2012-04-29 05:13 -0700
Last post2012-05-05 22:41 -0700
Articles 6 on this page of 26 — 10 participants

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


Contents

  my java is broken ! bilsch <king621@comcast.net> - 2012-04-29 05:13 -0700
    Re: my java is broken ! bilsch <king621@comcast.net> - 2012-04-29 05:36 -0700
      Re: my java is broken ! Roedy Green <see_website@mindprod.com.invalid> - 2012-04-29 07:05 -0700
    Re: my java is broken ! Joshua Cranmer <Pidgeot18@verizon.invalid> - 2012-04-29 09:25 -0500
      Re: my java is broken ! bilsch <king621@comcast.net> - 2012-04-29 15:21 -0700
        Re: my java is broken ! Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-04-29 20:06 -0300
          Re: my java is broken ! bilsch <king621@comcast.net> - 2012-05-03 15:03 -0700
            Re: my java is broken ! Lew <lewbloch@gmail.com> - 2012-05-03 16:05 -0700
              Re: my java is broken ! Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-05-03 20:44 -0300
                Re: my java is broken ! bilsch <king621@comcast.net> - 2012-05-03 22:38 -0700
                  Re: my java is broken ! Lew <lewbloch@gmail.com> - 2012-05-04 06:43 -0700
                  Re: my java is broken ! Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2012-05-04 14:07 +0000
                  Re: my java is broken ! Leif Roar Moldskred <leifm@dimnakorr.com> - 2012-05-04 09:11 -0500
                    Re: my java is broken ! bilsch <king621@comcast.net> - 2012-05-04 15:06 -0700
                      Re: my java is broken ! Martin Gregorie <martin@address-in-sig.invalid> - 2012-05-04 23:06 +0000
                        Re: my java is broken ! bilsch <king621@comcast.net> - 2012-05-05 15:03 -0700
                        Re: my java is broken ! bilsch <king621@comcast.net> - 2012-05-05 15:04 -0700
                      Re: my java is broken ! Lew <lewbloch@gmail.com> - 2012-05-04 17:04 -0700
                        Re: my java is broken ! bilsch <king621@comcast.net> - 2012-05-05 15:30 -0700
                          Re: my java is broken ! markspace <-@.> - 2012-05-05 15:58 -0700
                          Re: my java is broken ! Lew <noone@lewscanon.com> - 2012-05-05 22:37 -0700
                      Re: my java is broken ! Leif Roar Moldskred <leifm@dimnakorr.com> - 2012-05-04 19:48 -0500
                        Re: my java is broken ! Martin Gregorie <martin@address-in-sig.invalid> - 2012-05-05 15:02 +0000
                          Re: my java is broken ! bilsch <king621@comcast.net> - 2012-05-05 15:26 -0700
                            Re: my java is broken ! Martin Gregorie <martin@address-in-sig.invalid> - 2012-05-05 22:57 +0000
                            Re: my java is broken ! Lew <noone@lewscanon.com> - 2012-05-05 22:41 -0700

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


#14328

FromLew <noone@lewscanon.com>
Date2012-05-05 22:37 -0700
Message-ID<jo52mr$8dc$1@news.albasani.net>
In reply to#14302
bilsch wrote:
> Lew wrote:
>>
>> Please, please, please, please, *please* RTFM!
>
> I don't have the FM

Really? That's what you're going with? Come on, this is a professional group. 
You can do better than that.

Given that it's only a click away, that's on you.

You obviously have Internet access, because you are posting here.

Now go RTFM.

<http://lmgtfy.com/?q=Java+javac+command+reference>

-- 
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg

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


#14278

FromLeif Roar Moldskred <leifm@dimnakorr.com>
Date2012-05-04 19:48 -0500
Message-ID<__GdnXciLNRT5TnSnZ2dnUVZ7tudnZ2d@giganews.com>
In reply to#14271
bilsch <king621@comcast.net> wrote:
 
> I added /home/bilsch/jdk7/bin to PATH and was able to both compile and 
> run program Nvr1 from the command line.  Also, when I then go into 
> NetBeans and run the file it works without errors.  HOWEVER, AFTER I RUN 
> IN NETBEANS MY PATH STATEMENT REVERTS TO THE ORIGINAL VERSION ie.  the 
> /home/bilsch/jdk7/bin part has been removed.  I even put the PATH change 
> in two different places in the PATH variable and both were removed. Does 
> anybody have a java IDE other than NetBeans ?

This isn't a problem with NetBeans, but has to do with how environment
variables work. An "export" statement only sets an environment
variable for the current shell. To have the change stick, you need to
put the addition to PATH in a configuration file (most likely
~/.profile, but some linux distroes can be a little weird about it) so
that it will be set for every shell you open.

> Also, a pain in the ass is I must change directory to where the source 
> file resides to compile.  I must change directory to where the .class 
> file resides in order to run.

You don't have to do either of these. I suggest you follow Lew's
suggestion and read the documentation for the java and javac commands.

>  These directories are different for every 
> project therefore it's not practical to automate with a script.

You don't want to automate it with a script anyway -- you'll want to
automate it with a java build tool like ant or maven, but I recommend
that you spend some time just compiling and running things from the
command line first, to learn the basics properly.

-- 
Leif Roar Moldskred

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


#14283

FromMartin Gregorie <martin@address-in-sig.invalid>
Date2012-05-05 15:02 +0000
Message-ID<jo3fec$8uq$1@localhost.localdomain>
In reply to#14278
On Fri, 04 May 2012 19:48:14 -0500, Leif Roar Moldskred wrote:

> This isn't a problem with NetBeans, but has to do with how environment
> variables work. An "export" statement only sets an environment variable
> for the current shell. To have the change stick, you need to put the
> addition to PATH in a configuration file (most likely ~/.profile, but
> some linux distroes can be a little weird about it) so that it will be
> set for every shell you open.
>
In the Redhat family of distros you can make this sort of change by
putting a script in /etc/profile.d  

Scripts in profile.d are run after /etc/profile so I have one called 
java.sh which sets all my Java-related environment variables, e.g. 
JAVA_HOME, ANT_HOME and uses the pathmunge shell function to add /usr/
java/sdk/bin and /usr/java/ant/bin to $PATH

I make a lot of use symlinks: /usr/java is a symlink to /home/java so my 
Java set-up will survive a system reinstall. /home is in a separate 
partition that isn't reformatted during an install. 

Inside the /home/java directory, jdk is a symlink to the current Java SDK 
install and ant is a symlink to the current Ant install. This means that 
the contents of /etc/profile.d/java.sh doesn't change when I install a 
new version of the JDK: I merely switch the sdk symlink at the same time 
as I unpack the download.
  
>> Also, a pain in the ass is I must change directory to where the source
>> file resides to compile.  I must change directory to where the .class
>> file resides in order to run.
> 
> You don't have to do either of these. I suggest you follow Lew's
> suggestion and read the documentation for the java and javac commands.
>
Seconded.
 
>>  These directories are different for every
>> project therefore it's not practical to automate with a script.
> 
If you take the time to set your system up appropriately everything will 
'just work'.


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

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


#14301

Frombilsch <king621@comcast.net>
Date2012-05-05 15:26 -0700
Message-ID<jo49fc$7vk$1@dont-email.me>
In reply to#14283
On 05/05/2012 08:02 AM, Martin Gregorie wrote:
> On Fri, 04 May 2012 19:48:14 -0500, Leif Roar Moldskred wrote:
>
>> This isn't a problem with NetBeans, but has to do with how environment
>> variables work. An "export" statement only sets an environment variable
>> for the current shell. To have the change stick, you need to put the
>> addition to PATH in a configuration file (most likely ~/.profile, but
>> some linux distroes can be a little weird about it) so that it will be
>> set for every shell you open.
>>
> In the Redhat family of distros you can make this sort of change by
> putting a script in /etc/profile.d
>
> Scripts in profile.d are run after /etc/profile so I have one called
> java.sh which sets all my Java-related environment variables, e.g.
> JAVA_HOME, ANT_HOME and uses the pathmunge shell function to add /usr/
> java/sdk/bin and /usr/java/ant/bin to $PATH
>
> I make a lot of use symlinks: /usr/java is a symlink to /home/java so my
> Java set-up will survive a system reinstall. /home is in a separate
> partition that isn't reformatted during an install.
>
> Inside the /home/java directory, jdk is a symlink to the current Java SDK
> install and ant is a symlink to the current Ant install. This means that
> the contents of /etc/profile.d/java.sh doesn't change when I install a
> new version of the JDK: I merely switch the sdk symlink at the same time
> as I unpack the download.
>

It is interesting and I grasp the concepts but actually doing those 
things myself is beyond me.

>>> Also, a pain in the ass is I must change directory to where the source
>>> file resides to compile.  I must change directory to where the .class
>>> file resides in order to run.
>>
>> You don't have to do either of these. I suggest you follow Lew's
>> suggestion and read the documentation for the java and javac commands.
>>
> Seconded.
>
I can't find any documentation for command line java and javac.

>>>   These directories are different for every
>>> project therefore it's not practical to automate with a script.
>>
> If you take the time to set your system up appropriately everything will
> 'just work'.
>
>

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


#14306

FromMartin Gregorie <martin@address-in-sig.invalid>
Date2012-05-05 22:57 +0000
Message-ID<jo4b95$h2r$1@localhost.localdomain>
In reply to#14301
On Sat, 05 May 2012 15:26:51 -0700, bilsch wrote:

> It is interesting and I grasp the concepts but actually doing those
> things myself is beyond me.
>
Learn to use the command line and teach yourself the basics of writing 
shell scripts. Without these basic skills you're essentially crippling 
yourself.

If you understand any non-UNIX OS, get a copy of "Linux in a Nutshell". 
If don't know any OS at a reasonable depth, i.e you're not a power user, 
you need a less terse book. I hear that 'Linux for Dummies' is OK but 
haven't used it myself because I started using UNIX and UNIX clones in 
the late '80s, so the way Linux works was just more of the same when I 
started to use it. 
 
>>>> Also, a pain in the ass is I must change directory to where the
>>>> source file resides to compile.  I must change directory to where the
>>>> .class file resides in order to run.
>>>
>>> You don't have to do either of these. I suggest you follow Lew's
>>> suggestion and read the documentation for the java and javac commands.
>>>
>> Seconded.
>>
> I can't find any documentation for command line java and javac.
>
"java -?" or "man java" on the command line. Same for javac.
Or download and read the JDK documentation - this is a separate download 
from the JDK or JRE packages. If you don't have it installed you should 
do so.


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

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


#14329

FromLew <noone@lewscanon.com>
Date2012-05-05 22:41 -0700
Message-ID<jo52ua$8dc$2@news.albasani.net>
In reply to#14301
bilsch wrote:
> I can't find any documentation for command line java and javac.

What steps have you taken to find it?

Please specify the queries you used, and to which search engines, and what 
other web resources and literature you used.

-- 
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg

[toc] | [prev] | [standalone]


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

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


csiph-web