RE: Java under Fedora

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



FWIW, If you're looking to do anything moderately serious, you're going to want to use Maven to manage your build and dependencies...

$ mvn archetype:generate -DgroupId=com.foo.app -DartifactId=helloworld -DarchetypeArtifactId=maven-archetype-webapp
$ cd helloworld

add 
<dependency>
  <groupId>org.apache.tomcat</groupId>
  <artifactId>tomcat-servlet-api</artifactId>
  <version>7.0.12</version>
</dependency>

to the <dependencies> element

$ mkdir src/main/java

Add source files into src/main/java, jsp's / static resources into src/main/webapp, Your web.xml is in src/main/webapp/WEB-INF

To build a .war file:
$ mvn package

The war file will be sitting in target/helloworld.war

PK
-----Original message-----
From:	Timothy Murphy <gayleard@xxxxxxxxxx>
Sent:	Tue 11-03-2014 10:21
Subject:	RE: Java under Fedora
To:	users@xxxxxxxxxxxxxxxxxxxxxxx; 
> Patrick Kobly wrote:
> 
> > Add the servlet API JAR to the classpath (with -cp or CLASSPATH env
> > variable).  Or use Maven to build your projects and define the
> > dependencies appropriately.
> 
> >> When I run "javac HelloWorld.java" I get a number of errors like
> >>   HelloWorld.java:12: error: cannot find symbol
> >>     public class HelloWorld extends HttpServlet {
> >> 
> >> I see that this class is in /usr/share/java/tomcat-servlet-api.jar
> >> and if I expand this jar file in the current directory
> >> then the compilation succeeds.
> >> But it is not sufficient to copy the jar file to the current directory
> >> (or to put a link to it in /usr/lib/java/ .)> 
> 
> 
> > Add the servlet API JAR to the classpath (with -cp or CLASSPATH env
> > variable).  Or use Maven to build your projects and define the
> > dependencies appropriately.
> 
> Thanks very much,
>   export CLASSPATH=$CLASSPATH:/usr/share/java/tomcat-servlet-api.jar
> did the trick.
> I was assuming (rather stupidly) that it was sufficient
> to put the directory into the classpath.
> 
> .
>   
> 
> 
> 
> -- 
> Timothy Murphy  
> e-mail: gayleard /at/ eircom.net
> School of Mathematics, Trinity College, Dublin 2, Ireland
> 
> 
> -- 
> users mailing list
> users@xxxxxxxxxxxxxxxxxxxxxxx
> To unsubscribe or change subscription options:
> https://admin.fedoraproject.org/mailman/listinfo/users
> Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
> Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
> Have a question? Ask away: http://ask.fedoraproject.org
>
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org




[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux