[CentOS] Struggling with javac

Wed Aug 23 00:36:31 UTC 2006
John Hinton <webmaster at ew3d.com>

Seán O Sullivan wrote:
> John Hinton wrote:
>> javac -classpath /usr/local/tomcat/common/lib/servlet.jar 
>> HelloWorld.java
>>
>> as instructed fails with a
>>
>> gij: unrecognized option -- `-classpath'
>> Try `gij --help' for more information.
>
> My guess would be it should be '--classpath' not '-classpath'.
>
> Regards,
>
> Sean
>
Darn! Good guess.. but...

Actually here is the full output from and attempted compile. Apparently 
something is a bit 'different' on rhel3 systems.

javac -classpath /usr/local/tomcat/common/lib/servlet.jar HelloWorld.java
libgcj-java-placeholder.sh

This script is a placeholder for the /usr/bin/java
master link required by jpackage.org conventions.  libgcj's
rmiregistry, rmic and jar tools are now slave symlinks to these
masters, and are managed by the alternatives(8) system.

This change was necessary because the rmiregistry, rmic and jar tools
installed by previous versions of libgcj conflicted with symlinks
installed by jpackage.org JVM packages.

This script was designed to be overridden by the supported RHEL3 JRE
packages, java-1.4.2-bea and java-1.4.2-ibm.  It is installed as an
alternative symlink as /usr/bin/java.  It will override a third-party
(non-RHEL3) JRE's java command if the JRE's bin directory is listed
after /usr/bin in PATH.  In that case, it is recommended that the
third-party JRE's bin directory be listed first in PATH instead.

gij: unrecognized option -- `-classpath'
Try `gij --help' for more information.

and then output from gij --help

Usage: gij [OPTION] ... CLASS [ARGS] ...
          to interpret Java bytecodes, or
       gij -jar [OPTION] ... JARFILE [ARGS] ...
          to execute a jar file

  -DVAR=VAL         define property VAR with value VAL
  --help            print this help, then exit
  --ms=NUMBER       set initial heap size
  --mx=NUMBER       set maximum heap size
  --showversion     print version number, then keep going
  --version         print version number, then exit

See http://gcc.gnu.org/java/ for information on reporting bugs

So, I only see -jar from above which might be useful and am now getting

Failed to load Main-Class manifest attribute from
/usr/local/tomcat/common/lib/servlet-api.jar

so apparently this isn't what I need either.. or maybe I just don't know 
enough. All I want to do is compile a simple little example java script 
into a class so I can set up one "working from scratch" jsp webapp.

---Begin Side Rant as this is NOT CentOS----------
Wow!!! This whole server install has been the ultimate dawg! As for the 
above, I don't personally intend to do any scripting for use in the 
environment. I haven't done much with java at all (a shortcoming as I'm 
not familiar with Sun's lingo). All I want is to get to the end of this 
install and have a working system for what will be quite a few clients.. 
one is 'pressing' now (15 grand for a new website and they want it 
working now! >>>pressure<<<). I must say though, I can't remember going 
through anything so convoluted as the Jakarta/Tomcat install and 
attempting to run it from a shared hosting system. Compared to this, 
Apache is a piece of cake.. and sendmail and even FPSEs. Documentation 
from Sun is way worse than anything that has come out of Microsoft Press 
and basically assumes you know everything before and after what you're 
reading in order to understand what you're reading, which leads me to 
believe you wouldn't need to be reading at all as you would know 
everything already. Also, Sun seems to like to change things a bit.. 
almost as bad as Microsoft's renaming of the buttons in Outlook with 
each release.. or their forcing the use of 'Wizards' (it's magical IF it 
works!) for the most simplistic setting change to an email account.
---sorry.. End Rant.. I just needed to vent a bit----------

Thanks for any and all help!

John Hinton