I've installed jdk-1_5_0_08-linux-i586.rpm and Tomcat.
Working through some initial test install programs, I am finding that I can't seem to compile .java files into classes.
For instance...
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.
So then I notice there is no servlet.jar file, but instead a servlet-api.jar.. I change the command and it fails with the same problem. Trying the command without the -class and without the path fails with path errors. So it's sort of like this -classpath switch is either pathed wrong somewhere or is deprecated?
This is on a CentOS 3 server. Anybody run into this? Do you have a solution?
Thanks, John Hinton
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
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
John Hinton wrote:
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.
I'm making some progress (digress?). Doing the same thing on a CentOS 4 server, everything works as expected. This is my bet. I think the deal with Java being removed from RHEL during the version 3 days left some breakage. I'm guessing but I bet this came about as a result of the Sun's lawsuit against Microsoft for developing it own non-compatible jvm. It seemed to happen at about the same time. I notice you do have to go through the licensing screens to install jdk.. which I bet is why it can't be included in RHEL?
I also notice that Sun has announced a plan to make Java SE available as open-source code.. so maybe we'll have the ability to again do an install via the OS and it will be back into the hands of the upstream provider with regards initial installation, configuration and updating. I guess we'll see as the dust settles in Sun's final decisions.
Looking at removing the libgcj package brought up lots of dependency issues which might take a bit of time to sort through and maybe break something I don't know about.. so.. I'm jumping ship! Instead of pursuing this install on CentOS 3, I'm heading on over to one of my v4 boxes. I hope I've poked, prodded, drops files all over the place, rewritten config after config... maybe I'll actually get a clean first time install and have this up and running tonight <fingers crossed>.
Thanks for the input.
John Hinton
get the sun java binary and add it to our classpath at /etc/profile. but you must disable the gnujava too.
On 8/22/06, John Hinton webmaster@ew3d.com wrote:
John Hinton wrote:
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.
I'm making some progress (digress?). Doing the same thing on a CentOS 4 server, everything works as expected. This is my bet. I think the deal with Java being removed from RHEL during the version 3 days left some breakage. I'm guessing but I bet this came about as a result of the Sun's lawsuit against Microsoft for developing it own non-compatible jvm. It seemed to happen at about the same time. I notice you do have to go through the licensing screens to install jdk.. which I bet is why it can't be included in RHEL?
I also notice that Sun has announced a plan to make Java SE available as open-source code.. so maybe we'll have the ability to again do an install via the OS and it will be back into the hands of the upstream provider with regards initial installation, configuration and updating. I guess we'll see as the dust settles in Sun's final decisions.
Looking at removing the libgcj package brought up lots of dependency issues which might take a bit of time to sort through and maybe break something I don't know about.. so.. I'm jumping ship! Instead of pursuing this install on CentOS 3, I'm heading on over to one of my v4 boxes. I hope I've poked, prodded, drops files all over the place, rewritten config after config... maybe I'll actually get a clean first time install and have this up and running tonight <fingers crossed>.
Thanks for the input.
John Hinton _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
John Hinton wrote:
I've installed jdk-1_5_0_08-linux-i586.rpm and Tomcat.
Working through some initial test install programs, I am finding that I can't seem to compile .java files into classes.
For instance...
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.
So then I notice there is no servlet.jar file, but instead a servlet-api.jar.. I change the command and it fails with the same problem. Trying the command without the -class and without the path fails with path errors. So it's sort of like this -classpath switch is either pathed wrong somewhere or is deprecated?
This is on a CentOS 3 server. Anybody run into this? Do you have a solution?
Thanks, John Hinton _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
remove the libgcj package or configure tomcat to use the SUN JRE
leonel
You appear to be wanting to use Sun's java. However, installing the jdk-1_5_0_08-linux-i586.rpm RPM won't by default put java(c) in the path.
You can see this with java -verison.
Please download from jpackage.org java-1.5.0-sun-compat-1.5.0.08-1jpp.noarch.rpm
This is a wrapper that will place java and javac in the path and correctly modify all the jpackage file locations.
You can download it directly from
http://mirrors.dotsrc.org/jpackage/1.6/generic/non-free/RPMS/java-1.5.0-sun-...
HTH, Tarun
On Tue, 2006-08-22 at 17:24 -0400, John Hinton wrote:
I've installed jdk-1_5_0_08-linux-i586.rpm and Tomcat.
Working through some initial test install programs, I am finding that I can't seem to compile .java files into classes.
For instance...
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.
So then I notice there is no servlet.jar file, but instead a servlet-api.jar.. I change the command and it fails with the same problem. Trying the command without the -class and without the path fails with path errors. So it's sort of like this -classpath switch is either pathed wrong somewhere or is deprecated?
This is on a CentOS 3 server. Anybody run into this? Do you have a solution?
Thanks, John Hinton _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
One last note...
The java-1.5.0-sun-compat package requires the jdk rpm from Sun be installed. It does not actually contain the jdk!
You may also want to add jpackage.org's yum config to your local yum. You can get more info at jpackage.org
Tarun
On Wed, 2006-08-23 at 12:16 -0600, Tarun Reddy wrote:
You appear to be wanting to use Sun's java. However, installing the jdk-1_5_0_08-linux-i586.rpm RPM won't by default put java(c) in the path.
You can see this with java -verison.
Please download from jpackage.org java-1.5.0-sun-compat-1.5.0.08-1jpp.noarch.rpm
This is a wrapper that will place java and javac in the path and correctly modify all the jpackage file locations.
You can download it directly from
http://mirrors.dotsrc.org/jpackage/1.6/generic/non-free/RPMS/java-1.5.0-sun-...
HTH, Tarun
On Tue, 2006-08-22 at 17:24 -0400, John Hinton wrote:
I've installed jdk-1_5_0_08-linux-i586.rpm and Tomcat.
Working through some initial test install programs, I am finding that I can't seem to compile .java files into classes.
For instance...
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.
So then I notice there is no servlet.jar file, but instead a servlet-api.jar.. I change the command and it fails with the same problem. Trying the command without the -class and without the path fails with path errors. So it's sort of like this -classpath switch is either pathed wrong somewhere or is deprecated?
This is on a CentOS 3 server. Anybody run into this? Do you have a solution?
Thanks, John Hinton _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
An one more ... ;-)
You need:
From jpackage.org: java-1.5.0-sun-compat-1.5.0.08-1jpp.noarch.rpm
From SUN (it is unpacket from original SUN file jdk-1_5_0_08-linux-i586-rpm.bin): jdk-1_5_0_08-linux-i586.rpm
From CentOS 3 repos (base or updates): jpackage-utils-1.5.38-1jpp_5rh.noarch.rpm
after installation of you can see (and configure) which JAVA implemetation you will use:
# env LANG=C alternatives --config java
There are 2 programs which provide 'java'.
Selection Command ----------------------------------------------- + 1 /usr/share/java/libgcj-java-placeholder.sh * 2 /usr/lib/jvm/jre-1.5.0-sun/bin/java
Enter to keep the current selection[+], or type selection number:
As you see there are GCJ (which makes your problem "gij ..." and just installed SUN JDK. Choose what you prefer ... :)
Tarun Reddy wrote:
One last note...
The java-1.5.0-sun-compat package requires the jdk rpm from Sun be installed. It does not actually contain the jdk!
You may also want to add jpackage.org's yum config to your local yum. You can get more info at jpackage.org