• Willkommen im Linux Club - dem deutschsprachigen Supportforum für GNU/Linux. Registriere dich kostenlos, um alle Inhalte zu sehen und Fragen zu stellen.

Tomcat + Java + Struts Problem

Hallo zusammen!

Folgende Sachlage:
Habe ein frisches Opensuse 10.2 System und Java + Tomcat + Struts Beispiele installiert!

Wenn ich Tomcat starte und ein Struts-Bsp. mit

http://localhost:8080/struts-blank/

starten will, kommt folgende Fehlermeldung:

Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK
org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.getCompiler(CompilerAdapterFactory.java:105)
org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:924)
org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:757)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:407)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:497)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:476)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:464)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

JAVA_HOME ist aber gesetzt:
echo $JAVA_HOME
/usr/lib/jvm/jre

Wie gesagt, es ist alles "frisch" installiert und nichts wurde von mir verändert!
Hat wer Lösungsvorschläge?

Danke im Vorraus!
 
Hallo!

Danke für den Tipp. Es war mir nicht klar, dass bei SuSe nach der Installation des SDKs JAVA_HOME noch immer auf das JRE zeigt.

Hab die Datei /etc/java/java.conf geändert und jetzt funktioniert es.
 
ja aber man braucht kein 200 mb sun jdk download um friedlich java zu compilieren.

===============================
compile java with opensuse 10.2
===============================

how could i assume that a straightforward task like compiling java would work
outofthebox with opensuse 10.2

problem:
--------
gcj said:
your java rt.jar has no... zero-length... bla bla... i wont use it

solution:
---------
- removed gcj with yast

- downloaded
http://download.opensuse.org/distribution/10.2/repo/oss/suse/i586/jikes-1.22-34.i586.rpm
to /tmp

- run
rpm -hiv /tmp/jikes-1.22-34.i586.rpm

- compile happily and FAST with
jikes --classpath /usr/lib/jvm/jre/lib/rt.jar:. WhatEver.java
the . after the : is necessary, it indicates the present directory

- run it with
java WhatEver
 
Oben