Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > my java is broken !

Reply
Thread Tools

my java is broken !

 
 
bilsch
Guest
Posts: n/a
 
      05-04-2012
On 05/03/2012 04:44 PM, Arved Sandstrom wrote:
> On 12-05-03 08:05 PM, Lew wrote:
> [ SNIP ]
>
>> That said, the error message doesn't jibe well with what we're seeing. You don't call any constructors, so it's odd the error message refers to constructors.

> [ SNIP ]
>
> It doesn't jibe, no. OTOH, a search on the VerifyError message +
> "NetBeans" does turn up indications that NB exhibits this error in
> several situations. Often solved, just as with Eclipse in umpteen
> circumstances, with the classic "Clean-Rebuild-Try Again-Curse-Repeat"
> cycle.
>
> I wouldn't rule out that there is NetBeans badness here. I figure most
> of us have encountered situations where you open up an IDE on a project,
> where the day before everything was OK, and now suddenly it's seriously
> out of whack.
>
> Your suggestion to have the OP try the build and run on the command line
> is a great idea. I strongly second that.
>
> AHS


Programs java and javac are in directory: /home/bilsch/jdk7/bin/
Offending program, Nvr1.java is in directory:

/home/bilsch/NetBeansProjects/NVRAM/src/

environment variable PATH is:

/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

However note that when I run; java Nvr1.class (or simply Nvr1) from my
home directory the output errors are in javanese, as follows:

bilsch@p4pwj:~/jdk7/bin$ java Nvr1
Exception in thread "main" java.lang.NoClassDefFoundError: Nvr1
Caused by: java.lang.ClassNotFoundException: Nvr1
at java.net.URLClassLoader$1.run(URLClassLoader.java: 217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 21)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 66)
Could not find the main class: Nvr1. Program will exit.
bilsch@p4pwj:~/jdk7/bin$ cd
bilsch@p4pwj:~$ java Nvr1.class
Exception in thread "main" java.lang.NoClassDefFoundError: Nvr1/class
Caused by: java.lang.ClassNotFoundException: Nvr1.class
at java.net.URLClassLoader$1.run(URLClassLoader.java: 217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 21)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 66)

Could not find the main class: Nvr1.class. Program will exit.

Therefore the command line is hooked up with the java directory -
regardless of the PATH.

When I change working directory to /home/bilsch/jdk7/bin/ and type in
the path and filename for the offending file I get the following output:

bilsch@p4pwj:~/jdk7/bin$ javac /NetBeansProjects/NVRAM/src/Nvr1

The program 'javac' can be found in the following packages:
* openjdk-6-jdk
* ecj
* gcj-4.4-jdk
* gcj-4.6-jdk
* gcj-4.5-jdk
* openjdk-7-jdk
Try: sudo apt-get install <selected package>
bilsch@p4pwj:~/jdk7/bin$
bilsch@p4pwj:~/jdk7/bin$

Ubuntu can't find javac even though I ran it from the directory where
javac resides. It can't find it from the home directory either.

THE SHORT ANSWER IS I CAN'T COMPILE OR RUN JAVA FROM MY LINUX COMMAND
LINE. I can't answer your question of what the output is when running
command line. Also I have no idea why Linux won't do it. I'LL HAVE TO
WORK ON THAT.

I have to figure how to run from command line in linux. If I could run
using Windows command line and it worked that would be inconclusive ie.
taking Linux out of the equation. If I could run it in Windows command
line tonight and it worked OK that wouldn't mean it would still work 4
days from now?

This could be a Linux glitch rather than Java.

Thanks for listening. Bill S.

 
Reply With Quote
 
 
 
 
Lew
Guest
Posts: n/a
 
      05-04-2012
bilsch wrote:
> Programs java and javac are in directory: /home/bilsch/jdk7/bin/
> Offending program, Nvr1.java is in directory:
>
> /home/bilsch/NetBeansProjects/NVRAM/src/
>
> environment variable PATH is:
>
> /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
>
> However note that when I run; java Nvr1.class (or simply Nvr1) from my
> home directory the output errors are in javanese, as follows:
>
> bilsch@p4pwj:~/jdk7/bin$ java Nvr1
> Exception in thread "main" java.lang.NoClassDefFoundError: Nvr1
> Caused by: java.lang.ClassNotFoundException: Nvr1
> at java.net.URLClassLoader$1.run(URLClassLoader.java: 217)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.j ava:205)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:3 21)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:294)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:2 66)
> Could not find the main class: Nvr1. Program will exit.
> bilsch@p4pwj:~/jdk7/bin$ cd
> bilsch@p4pwj:~$ java Nvr1.class
> Exception in thread "main" java.lang.NoClassDefFoundError: Nvr1/class
> Caused by: java.lang.ClassNotFoundException: Nvr1.class
> at java.net.URLClassLoader$1.run(URLClassLoader.java: 217)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.j ava:205)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:3 21)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:294)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:2 66)
>
> Could not find the main class: Nvr1.class. Program will exit.
>
> Therefore the command line is hooked up with the java directory -
> regardless of the PATH.


Huh?

Besides that I'm not sure what you mean by "the command line is hooked up with the java directory", there is no reason to associate the PATH envar with the error you show, which is simply due to the fact that you did not specify the classpath correctly. Or at all. And tried to run the Java program from a directory such that the default classpath does not include it.


> When I change working directory to /home/bilsch/jdk7/bin/ and type in
> the path and filename for the offending file I get the following output:
>
> bilsch@p4pwj:~/jdk7/bin$ javac /NetBeansProjects/NVRAM/src/Nvr1
>
> The program 'javac' can be found in the following packages:
> * openjdk-6-jdk
> * ecj
> * gcj-4.4-jdk
> * gcj-4.6-jdk
> * gcj-4.5-jdk
> * openjdk-7-jdk
> Try: sudo apt-get install <selected package>
> bilsch@p4pwj:~/jdk7/bin$
> bilsch@p4pwj:~/jdk7/bin$
>
> Ubuntu can't find javac even though I ran it from the directory where
> javac resides. It can't find it from the home directory either.
>
> THE SHORT ANSWER IS I CAN'T COMPILE OR RUN JAVA FROM MY LINUX COMMAND
> LINE. I can't answer your question of what the output is when running


Shh.

> command line. Also I have no idea why Linux won't do it. I'LL HAVE TO
> WORK ON THAT.


Shh.

You showed us the output. Why do you say you can't answer the question thatyou just answered?

> I have to figure how to run from command line in linux. If I could run


You could try reading the documentation for the "java" command.

Try this:

$ java -cp ${directory_where_the_class_file_is} Nvr1

> using Windows command line and it worked that would be inconclusive ie.
> taking Linux out of the equation. If I could run it in Windows command
> line tonight and it worked OK that wouldn't mean it would still work 4
> days from now?


If you were to specify the command line correctly, it would work right now,in Linux.

> This could be a Linux glitch rather than Java.


No, it's operator error.

Neither Linux nor Java is at fault.

You need to read the documentation for the commands you're using, is all.

Had you done so, you'd've known up front that "java Nvr1.class" is wrong always, and why your attempt to run "java Nvr1" without a matching classpath failed.

Which it would do in the same way in Windows for the same reason.

RTFM.

--
Lew
 
Reply With Quote
 
 
 
 
Andreas Leitgeb
Guest
Posts: n/a
 
      05-04-2012
bilsch <(E-Mail Removed)> wrote:
> environment variable PATH is:
> /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games


> bilsch@p4pwj:~/jdk7/bin$ java Nvr1


You don't have "." or ~/jdk7/bin in your PATH. So it probably has
picked up some system-installed java from /usr/bin

Add the bin directory of your jdk7 to the beginning of your PATH,
and some of your obstacles might dissolve.

Anyway, your Nvr1.class file surely isn't in ~/jdk7/bin, so the
> Could not find the main class: Nvr1. Program will exit.

was to be expected.

> bilsch@p4pwj:~/jdk7/bin$ javac /NetBeansProjects/NVRAM/src/Nvr1
> The program 'javac' can be found in the following packages:


That's a shell-convenience, and it seems like you have a jre
installed system-wide, but not a jdk.

To actually use your priovate jdk7 installation, you have to
add it to your PATH (and before /usr/bin)

Your PATH probably should look like:
/home/bilsch/jdk7/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

(I'm speculating about your actual home-directory here)

 
Reply With Quote
 
bilsch
Guest
Posts: n/a
 
      05-04-2012
On 05/04/2012 07:11 AM, Leif Roar Moldskred wrote:
> bilsch<(E-Mail Removed)> wrote:
>
>>
>> Programs java and javac are in directory: /home/bilsch/jdk7/bin/
>> Offending program, Nvr1.java is in directory:
>>
>> /home/bilsch/NetBeansProjects/NVRAM/src/
>>
>> environment variable PATH is:
>>
>> /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

>
> And there's your problem -- your PATH does not contain the directory
> your java and javac commands are found in, neither as an explicit
> entry of /home/bilsch/jdk7/bin/ or implicitly through the current
> directory .
>
>> However note that when I run; java Nvr1.class (or simply Nvr1) from my
>> home directory the output errors are in javanese, as follows:
>>
>> bilsch@p4pwj:~/jdk7/bin$ java Nvr1
>> Exception in thread "main" java.lang.NoClassDefFoundError: Nvr1
>> Caused by: java.lang.ClassNotFoundException: Nvr1

>
> You're running a java command here, but not the one at
> /home/bilsch/jdk7/bin/java -- you must have another java command in
> your system somewhere. (Try the command "which java" to show where
> the java command that's actually being run is.)
>
> The solution is to add the directory /home/bilsch/jdk7/bin/ to the
> front of your PATH. Write the following command on the command line:
>
> export PATH=/home/bilsch/jdk7/bin/:$PATH
>
> You should then be able to call javac, use that to create a .class
> file and then use java to run the class file.
>


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 ?

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. These directories are different for every
project therefore it's not practical to automate with a script.

Bill S.


 
Reply With Quote
 
Martin Gregorie
Guest
Posts: n/a
 
      05-04-2012
On Fri, 04 May 2012 15:06:43 -0700, bilsch wrote:

> On 05/04/2012 07:11 AM, Leif Roar Moldskred wrote:
>> bilsch<(E-Mail Removed)> wrote:
>>
>>
>>> Programs java and javac are in directory: /home/bilsch/jdk7/bin/
>>> Offending program, Nvr1.java is in directory:
>>>
>>> /home/bilsch/NetBeansProjects/NVRAM/src/
>>>
>>> environment variable PATH is:
>>>
>>> /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/

usr/bin:/sbin:/bin:/usr/games
>>
>> And there's your problem -- your PATH does not contain the directory
>> your java and javac commands are found in, neither as an explicit entry
>> of /home/bilsch/jdk7/bin/ or implicitly through the current directory .
>>
>>> However note that when I run; java Nvr1.class (or simply Nvr1) from my
>>> home directory the output errors are in javanese, as follows:
>>>
>>> bilsch@p4pwj:~/jdk7/bin$ java Nvr1 Exception in thread "main"
>>> java.lang.NoClassDefFoundError: Nvr1 Caused by:
>>> java.lang.ClassNotFoundException: Nvr1

>>
>> You're running a java command here, but not the one at
>> /home/bilsch/jdk7/bin/java -- you must have another java command in
>> your system somewhere. (Try the command "which java" to show where the
>> java command that's actually being run is.)
>>
>> The solution is to add the directory /home/bilsch/jdk7/bin/ to the
>> front of your PATH. Write the following command on the command line:
>>
>> export PATH=/home/bilsch/jdk7/bin/:$PATH
>>
>> You should then be able to call javac, use that to create a .class file
>> and then use java to run the class file.
>>
>>

> 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 ?
>

Look at where PATH is defined in the NetBeans configuration and change
that.

> 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. These directories are different for every
> project therefore it's not practical to automate with a script.
>

Either use Ant (write a build.xml file if you can't use the one that
NetBeans uses) and/or write a shell script to run the compile from the
correct directory.


--
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |
 
Reply With Quote
 
Lew
Guest
Posts: n/a
 
      05-05-2012
bilsch wrote:
> 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. These directories are different for every
> project therefore it's not practical to automate with a script.


That is totally untrue.

Both the compiler ("javac") and the runtime ("java") respect classpaths,
and the latter respects source paths. With those, you can compile and run
Java code from any directory regardless of your current directory.

Please, please, please, please, *please* RTFM!

Especially before you start ranting incorrectly about what is not possible.

Why did you ignore the earlier advice to do that?

--
Lew
 
Reply With Quote
 
Martin Gregorie
Guest
Posts: n/a
 
      05-05-2012
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 |
 
Reply With Quote
 
bilsch
Guest
Posts: n/a
 
      05-05-2012
On 05/04/2012 04:06 PM, Martin Gregorie wrote:
> On Fri, 04 May 2012 15:06:43 -0700, bilsch wrote:
>
>> On 05/04/2012 07:11 AM, Leif Roar Moldskred wrote:
>>> bilsch<(E-Mail Removed)> wrote:
>>>
>>>
>>>> Programs java and javac are in directory: /home/bilsch/jdk7/bin/
>>>> Offending program, Nvr1.java is in directory:
>>>>
>>>> /home/bilsch/NetBeansProjects/NVRAM/src/
>>>>
>>>> environment variable PATH is:
>>>>
>>>> /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/

> usr/bin:/sbin:/bin:/usr/games
>>>
>>> And there's your problem -- your PATH does not contain the directory
>>> your java and javac commands are found in, neither as an explicit entry
>>> of /home/bilsch/jdk7/bin/ or implicitly through the current directory .
>>>
>>>> However note that when I run; java Nvr1.class (or simply Nvr1) from my
>>>> home directory the output errors are in javanese, as follows:
>>>>
>>>> bilsch@p4pwj:~/jdk7/bin$ java Nvr1 Exception in thread "main"
>>>> java.lang.NoClassDefFoundError: Nvr1 Caused by:
>>>> java.lang.ClassNotFoundException: Nvr1
>>>
>>> You're running a java command here, but not the one at
>>> /home/bilsch/jdk7/bin/java -- you must have another java command in
>>> your system somewhere. (Try the command "which java" to show where the
>>> java command that's actually being run is.)
>>>
>>> The solution is to add the directory /home/bilsch/jdk7/bin/ to the
>>> front of your PATH. Write the following command on the command line:
>>>
>>> export PATH=/home/bilsch/jdk7/bin/:$PATH
>>>
>>> You should then be able to call javac, use that to create a .class file
>>> and then use java to run the class file.
>>>
>>>

>> 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 ?
>>

> Look at where PATH is defined in the NetBeans configuration and change
> that.

I can't find any place where path is defined in NetBeans. They told me
two ways to change PATH outside of NetBeans. I did that.
>
>> 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. These directories are different for every
>> project therefore it's not practical to automate with a script.
>>

> Either use Ant (write a build.xml file if you can't use the one that
> NetBeans uses) and/or write a shell script to run the compile from the
> correct directory.


I have an ANT directory and a tab for it in NetBeans but I dont know if
it is installed. Same goes for Maven. I tried starting it on the
command line ant there it says to install it.
>
>


 
Reply With Quote
 
bilsch
Guest
Posts: n/a
 
      05-05-2012
On 05/04/2012 04:06 PM, Martin Gregorie wrote:
> On Fri, 04 May 2012 15:06:43 -0700, bilsch wrote:
>
>> On 05/04/2012 07:11 AM, Leif Roar Moldskred wrote:
>>> bilsch<(E-Mail Removed)> wrote:
>>>
>>>
>>>> Programs java and javac are in directory: /home/bilsch/jdk7/bin/
>>>> Offending program, Nvr1.java is in directory:
>>>>
>>>> /home/bilsch/NetBeansProjects/NVRAM/src/
>>>>
>>>> environment variable PATH is:
>>>>
>>>> /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/

> usr/bin:/sbin:/bin:/usr/games
>>>
>>> And there's your problem -- your PATH does not contain the directory
>>> your java and javac commands are found in, neither as an explicit entry
>>> of /home/bilsch/jdk7/bin/ or implicitly through the current directory .
>>>
>>>> However note that when I run; java Nvr1.class (or simply Nvr1) from my
>>>> home directory the output errors are in javanese, as follows:
>>>>
>>>> bilsch@p4pwj:~/jdk7/bin$ java Nvr1 Exception in thread "main"
>>>> java.lang.NoClassDefFoundError: Nvr1 Caused by:
>>>> java.lang.ClassNotFoundException: Nvr1
>>>
>>> You're running a java command here, but not the one at
>>> /home/bilsch/jdk7/bin/java -- you must have another java command in
>>> your system somewhere. (Try the command "which java" to show where the
>>> java command that's actually being run is.)
>>>
>>> The solution is to add the directory /home/bilsch/jdk7/bin/ to the
>>> front of your PATH. Write the following command on the command line:
>>>
>>> export PATH=/home/bilsch/jdk7/bin/:$PATH
>>>
>>> You should then be able to call javac, use that to create a .class file
>>> and then use java to run the class file.
>>>
>>>

>> 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 ?
>>

> Look at where PATH is defined in the NetBeans configuration and change
> that.
>
>> 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. These directories are different for every
>> project therefore it's not practical to automate with a script.
>>

> Either use Ant (write a build.xml file if you can't use the one that
> NetBeans uses) and/or write a shell script to run the compile from the
> correct directory.
>
>

I'm not too handy with shell programming.
 
Reply With Quote
 
bilsch
Guest
Posts: n/a
 
      05-05-2012
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'.
>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why are "broken iterators" broken? Steven D'Aprano Python 8 09-28-2008 09:19 PM
Re: Why are "broken iterators" broken? Fredrik Lundh Python 0 09-22-2008 04:32 PM
Re: Why are "broken iterators" broken? Cameron Simpson Python 0 09-22-2008 04:32 AM
PDM broken after Java update Cisco Fan Cisco 1 04-21-2005 03:13 PM
terrible java.net.SocketException: Broken pipe, please HELP!! Tomas Penc Java 3 10-24-2003 09:22 AM



Advertisments