Home » Newcomers » Newcomers » java1.5 and javaSDK ee 5 installed, only 1.5 found by system
java1.5 and javaSDK ee 5 installed, only 1.5 found by system [message #242839] |
Tue, 11 December 2007 15:51  |
Eclipse User |
|
|
|
Originally posted by: cuco2772.gmail.com
Since I have eclipse ee europa installed, I realized I needed to upgrade
my java from se 1.5 to the java ee 5 SDK, so I downloaded to
SDK with JDK .bin file from the sun site, and have made all the necessary
changes that I know of, but if I say 'which javac', it says /usr/bin/javac.
This is a real bugger of a problem, here's what I've done to try to
fix it:
I have java version "1.5.0_11", I cant compile servlets so I installed
this one, the SDK with JDK : java_ee_sdk-5_03-linux.bin, in /opt/SDK/jdk
Problem is, if I do javac, it only finds the 1.5 version, so I cant
compile servlets. I've reset $JAVA_HOME to /opt/SDK/jdk, doesnt help.
My other java and javac are in /opt/SDK/jdk/bin. Since I installed the
first
Java, the 1.5 one, using apt-get everything worked, so I thought maybe if I
tried to make a deb package out of the new Java, it might work.
So I did apt-get install java-package.
Here's what I did after that:
cuco@coat:~/Desktop$ fakeroot make-jpkg java_ee_sdk-5_03-linux.bin
Creating temporary directory: /tmp/make-jpkg.WOrlLt6874
Loading plugins: blackdown-j2re.sh blackdown-j2sdk.sh common.sh
ibm-j2re.sh ibm-j2sdk.sh j2re.sh j2sdk-doc.sh j2sdk.sh j2se.sh sun-j2re.sh
sun-j2sdk-doc.sh sun-j2sdk.sh
Detected Debian build architecture: i386
Detected Debian GNU type: i486-linux-gnu
No matching plugin was found.
Removing temporary directory: done
I'm about ready to give up at this point, any ideas on what to try ?
update-alterenatives doesnt find the right java either.
I dont know how to deal with the plugin issue. I posted a thread on the
ubuntu
forums and looked at similar threads there, but no answers.
I thought I'd try here, even though is only indirectly related to eclipse
|
|
|
Re: java1.5 and javaSDK ee 5 installed, only 1.5 found by system [message #242844 is a reply to message #242839] |
Tue, 11 December 2007 18:21   |
Eclipse User |
|
|
|
Adam Posner wrote:
> Since I have eclipse ee europa installed, I realized I needed to upgrade
> my java from se 1.5 to the java ee 5 SDK, so I downloaded to SDK with
> JDK .bin file from the sun site, and have made all the necessary
> changes that I know of, but if I say 'which javac', it says /usr/bin/javac.
>
>
> This is a real bugger of a problem, here's what I've done to try to
> fix it:
>
> I have java version "1.5.0_11", I cant compile servlets so I installed
> this one, the SDK with JDK : java_ee_sdk-5_03-linux.bin, in /opt/SDK/jdk
> Problem is, if I do javac, it only finds the 1.5 version, so I cant
> compile servlets. I've reset $JAVA_HOME to /opt/SDK/jdk, doesnt help.
> My other java and javac are in /opt/SDK/jdk/bin. Since I installed the
> first
> Java, the 1.5 one, using apt-get everything worked, so I thought maybe if I
> tried to make a deb package out of the new Java, it might work. So I did
> apt-get install java-package.
>
> Here's what I did after that:
>
> cuco@coat:~/Desktop$ fakeroot make-jpkg java_ee_sdk-5_03-linux.bin
> Creating temporary directory: /tmp/make-jpkg.WOrlLt6874
> Loading plugins: blackdown-j2re.sh blackdown-j2sdk.sh common.sh
> ibm-j2re.sh ibm-j2sdk.sh j2re.sh j2sdk-doc.sh j2sdk.sh j2se.sh
> sun-j2re.sh sun-j2sdk-doc.sh sun-j2sdk.sh
>
> Detected Debian build architecture: i386
> Detected Debian GNU type: i486-linux-gnu
>
> No matching plugin was found.
> Removing temporary directory: done
>
> I'm about ready to give up at this point, any ideas on what to try ?
> update-alterenatives doesnt find the right java either.
> I dont know how to deal with the plugin issue. I posted a thread on the
> ubuntu
> forums and looked at similar threads there, but no answers. I thought
> I'd try here, even though is only indirectly related to eclipse
>
Hi Adam. This is probably a dumb question, but... As you may know,
Eclipse doesn't care about the $JAVA_HOME and javac stuff (unless of
course that means that the correct JRE is not properly installed).
So, have you actually tried going into Eclipse and checking if the JRE
is visible there? (Window/Preferences/Java/Installed JRE's) A long shot,
to be sure, but worth checking. HTH. Mark
|
|
| | |
Re: java1.5 and javaSDK ee 5 installed, only 1.5 found by system [message #242867 is a reply to message #242854] |
Tue, 11 December 2007 22:16   |
Eclipse User |
|
|
|
Originally posted by: cuco2772.gmail.com
I will try to be more specific about my problems.
I am trying to set up eclipse > tomcat > mysql development on my ubuntu
laptop
to java enterprise web development. I am a noob at doing this kind of
stuff, so
please forgive me if I say or do some dumb things.
When I try to start tomcat from eclipse, I get some error msg like
'Failed to publish ... configuration may be corrupt'.
It lists the directory in eclipse as Servers/apache-tomcat-6.0.14, on my
machine its actually in /usr/local/tomcat/apache-tomcat-6.0.14., not sure
if that matters. Whether I have previously started tomcat from a terminal
window or not,
it doesnt seem to matter as far as getting it to work in eclipse.
I did add apache-tomcat to my Servers (in eclipse), it shows up as
apache-tomcat-6.0.14.
As far as my Java issues go, I just now tried the suggestion of going to
Windows > Preferences in eclipse to see if I could find the new JRE I
installed
from there. I tried to add it by navigating (in that window that comes up)
to /opt/SDK/JDK/jre and hit add. It says there's jre found there !
I was initially confused about what to install from Sun's Java download
site.
As I said, I had a while back installed the sun-java-1.5 package using
apt-get.
When I looked at the Java 1.5 API docs, I didnt see any class definition
for
HttpServlet, so I figured I needed the Java ee 5 SDK edition. I first
downloaded the .bin that didnt include the JDK (since I already had a JDK),
nothing worked, so I removed my SDK directory and all the files in it, and
then downloaded the .bin with the JDK to /opt/SDK. So now I have
java ee 5 SDK (with JDK included) installed in /opt/SDK. There's a jre
directory in there, so I'm assuming everything I need Java wise should be
in /opt/SDK.
I have reset my $JAVA_HOME in my .bashrc (and in my /etc/bash.bashrc, this
is
ubuntu,so I did it there too, dont know if I needed to) to
/opt/SDK/jdk. (I'm wondering if I should have set it to /opt/SDK/jdk/bin or
something. )
I have a very simple HelloServlet.java located in
/usr/local/tomcat/apache-tomcat-6.0.14/webapps/ROOT/WEB-INF
When I do javac HelloServlet.java, I get the error message
'package javax.servlet.http does not exist'.
If I do a 'which java' or 'which javac' I get /usr/bin/java or
/usr/bin/javac.
I have a javac and a java for the new version I just installed in the
bin directory off /opt/SDK/jdk, so the new javac and java for the
java ee 5 SDK with the jdk are there, itlooks like there's a whole jre off
that /opt/SDK/jdk, but for some reason, only the jre that I originally
installed
in /usr/lib/jvm gets found. I havent found a jvm directory off of
/opt/SDK/jdk,
but I think all the same stuff is probably in there, just in different
directories.
By the way, if I go to localhost:8080, I get the tomcat home page, so its
set up correctly. When I start tomcat, I get this :
root@coati:/usr/local/tomcat/apache-tomcat-6.0.14/bin# ./startup.sh
Using CATALINA_BASE: /usr/local/tomcat/apache-tomcat-6.0.14
Using CATALINA_HOME: /usr/local/tomcat/apache-tomcat-6.0.14
Using CATALINA_TMPDIR: /usr/local/tomcat/apache-tomcat-6.0.14/temp
Using JRE_HOME: /opt/SDK/jdk
Not sure what to make of this problem. Any ideas on what to do about this
would be awesome, I'm about at my wits end. Sorry for the long post.
|
|
| | | | | | |
Re: java1.5 and javaSDK ee 5 installed, only 1.5 found by system [message #243008 is a reply to message #242945] |
Thu, 13 December 2007 09:36   |
Eclipse User |
|
|
|
Originally posted by: eclipse-news.rizzoweb.com
Adam Posner wrote:
> Yes, the symlinks are pointing to the Java 1.5, not the SDK, they all
> point to /usr/lib/jvm/java-1.5.0-sun/.
> java-1.5.0-sun is itself a symlink to java-1.5.0-sun-1.5.0.11, the
> actual location. That'a why I was thinking of changing the
> java-1.5.0-sun symlink
> to point to somewhere like /opt/SDK/jdk. I'm not sure if you can change
> the value
> of a symlink to a new value, maybe that would be a solution if I knew
> everyplace
> I needed to do it.
> What file would I edit to change the config for eclipse ?
> (Right now I cant even run tomcat from eclipse, but changing eclipse to
> use the Java I want would be a start) Thanks for the help, by the way.
> I'm amazed at how difficult it is to find any good docs on any of this.
The troubles you are having is exactly the reason why system-wide
classpath and JVM settings are to be avoided at almost any cost, IMO.
Each app should be told explicitly what JVM to run under.
Anyway, there are lots of examples of eclipse.ini in the archives of
these newsgroups - Google can find them for you.
Here is a page that talks in detail about the eclipse.ini file,
including the -vm option that you are most interested in.
http://www.eclipse.org/swt/launcher.html
Hope this helps,
Eric
|
|
| |
Re: java1.5 and javaSDK ee 5 installed, only 1.5 found by system [message #243029 is a reply to message #243020] |
Thu, 13 December 2007 16:36   |
Eclipse User |
|
|
|
Adam Posner wrote:
> One thing that isnt clear is whether the jdk includes the jvm.
> I dont see a jvm folder in my /opt/SDK/jdk directory where I installed
> the 'java ee 5 SDK with JDK' download. Maybe there isnt a jvm there.
> I see a jre folder. This has a bin, lib, javaws, and plugin subdirectories.
> I'll copy and paste the contents of each below:
>
> root@coati:/opt/SDK/jdk/jre# ls bin
> ControlPanel java_vm jcontrol orbd policytool rmiregistry
> tnameserv
> java javaws keytool pack200 rmid servertool
> unpack200
> root@coati:/opt/SDK/jdk/jre# ls javaws
> javaws
> root@coati:/opt/SDK/jdk/jre#
> root@coati:/opt/SDK/jdk/jre# ls lib
> applet fontconfig.Turbo.properties.src
> audio fonts
> calendars.properties i386
> charsets.jar im
> classlist images
> cmm javaws.jar
> content-types.properties jce.jar
> deploy jexec
> deploy.jar jsse.jar
> desktop jvm.hprof.txt
> ext locale
> flavormap.properties logging.properties
> fontconfig.bfc management
> fontconfig.properties.src management-agent.jar
> fontconfig.RedHat.2.1.bfc meta-index
> fontconfig.RedHat.2.1.properties.src net.properties
> fontconfig.RedHat.3.bfc oblique-fonts
> fontconfig.RedHat.3.properties.src plugin.jar
> fontconfig.RedHat.bfc psfontj2d.properties
> fontconfig.RedHat.properties.src psfont.properties.ja
> fontconfig.Sun.bfc resources.jar
> fontconfig.Sun.properties.src rt.jar
> fontconfig.SuSE.bfc security
> fontconfig.SuSE.properties.src sound.properties
> fontconfig.Turbo.bfc zi
> root@coati:/opt/SDK/jdk/jre#
> root@coati:/opt/SDK/jdk/jre# ls plugin
> desktop i386
> root@coati:/opt/SDK/jdk/jre#
> I wonder if I just installed
>
>
Hi Adam. I think the JRE (Java Runtime Environment) includes the JVM. I
find this very confusing, even after just trying to read the Wikipedia
definitions of both. If I'm reading correctly, the JVM is just the
program that actually runs the .class files for that hardware platform
(e.g., java.exe on Windows), and the JRE includes both this and the
bundled class libraries that come with the Java language (i.e., the
rt.jar and other .jar files included with the JRE).
So there is no separate JVM download that one would normally use. HTH. Mark
|
|
| |
Re: java1.5 and javaSDK ee 5 installed, only 1.5 found by system [message #243058 is a reply to message #243036] |
Fri, 14 December 2007 09:27   |
Eclipse User |
|
|
|
Originally posted by: eclipse-news.rizzoweb.com
Adam Posner wrote:
> Yes, you are right. For ex., the path /opt/SDK/jdk/demo/jvmti has the same
> files as /usr/lib/jvm/java-1.5.0-sun-1.5.0.11/demo/jvmti. I changed the
> version in eclipse.ini to 1.6 which is the one that is included in the
> SDK that I downloaded. After reading that link posted by Eric, I thought
> I would try launching
> eclipse from the command line, using the -vm option to pass in the right
> VM that I wanted. I'm not sure how to refer to the VM, though. I've
> tried various things
> like root@coati:/opt/eclipse# ./eclipse -vm javaVM1.6. Seg fault there.
> I've also tried using the entire path,ie root@coati:/opt/eclipse#
> ./eclipse -vm /opt/SDK/jdk/jre/bin/java_vm.
> Evidently you cant launch it from the comand line without getting a
> segfault, maybe it has to do with an X11 display var not being set.
> Here's what it says:
>
> root@coati:/opt/eclipse# ./eclipse -vm /opt/SDK/jdk/jre/bin/java_vm
> java_vm process: You need to set both JAVA_HOME and PLUGIN_HOME
I have no idea what java_vm is, but I'm pretty sure the java executable
for the Sun JDKs and JREs is just named 'java'
So you'd need to specify -vm /path/to/where/java/is/installed/bin/java
The value of the -vm option must be the full path to the java executable.
I honestly don't understand why you're having so much trouble -
thousands of people run Eclipse on Linux every day. I would recommend
installing the Sun JDK into a new location and then editing eclipse.ini
to point to its java executable. On one Red Hat system I use, that is
/usr/java/jdk1.5.0_07/bin/java
Hope this helps,
Eric
|
|
|
Re: java1.5 and javaSDK ee 5 installed, only 1.5 found by system [message #243169 is a reply to message #243058] |
Fri, 14 December 2007 14:40  |
Eclipse User |
|
|
|
Originally posted by: cuco2772.gmail.com
I was thinking maybe it would be better to put it in the /usr dir.
I just tried starting the application server:
/opt/SDK/jdk/bin/asadmin start-domain domain1
Which I was able to start with the other install, but not now. The asadmin
program is not even there. it seems like the documentation that Sun gives
you
might not even be correct for the version you've downloaded.
Is the Sun application server even something I need to worry about ?
I want to delete everything I've downloaded and start from scratch.
Any advice on which version to download ?
http://java.sun.com/javaee/downloads/?intcmp=1282
Sun's site is confusing about what you need. If I could get away with
using J2SE 1.6 I could just use apt-get and everything would be fine.
But I dont see any class definition for HttpServlet in the API docs,
so I'm assuming I need j2ee 5.
One option would be to just keep the j2se 1.5 that I have now and just
download the ee 5 SDK, but I'm not sure where to put the download package
to
make sure files will be found by 1.5 compiler.
Here's what my current directory structure looks like for the 1.5 version
that I installed using apt-get:
root@coati:/usr/lib/jvm/java-1.5.0-sun-1.5.0.11# ls
bin docs jre man src.zip
COPYRIGHT ext lib README.html THIRDPARTYLICENSEREADME.txt
demo include LICENSE sample
Downloading the .bin file from the Sun site and running it extracts
everything
into a directory called SDK. Any idea where I should put that directory ?
What's weird is all the stuff having to do with jdk is in
/usr/share/doc/sun-java5-jdk, they're all documentation files. (This is
for the
1.5 version, I did an apt-get for the docs)
Anyway, what I recently downloaded and installed in /opt was from this
download: java_ee_sdk-5_03-linux.bin (update 3) This seems like it should
should be the right one.
Maybe the easiest question to ask would be, for those of you that manually
downloaded and installed some version of java ee on Linux, (with the tomcat
container), how did you get it working so you could compile and run simple
servlets on it ? I think if I get that working it will be easier to focus
on the eclipse configuration knowing that at least the Java part works.
|
|
|
Goto Forum:
Current Time: Wed Mar 12 00:56:43 EDT 2025
Powered by FUDForum. Page generated in 0.13511 seconds
|