Skip to content
Snippets Groups Projects
Commit fa1a1cfe authored by Amaury Vanoorenberghe's avatar Amaury Vanoorenberghe :scroll:
Browse files

SETUP - Correction de bugs dans les scripts de build eet suppression des

.class
parent 9d0cda73
Branches
No related tags found
No related merge requests found
[Bb]uild/
.class
\ No newline at end of file
*.class
......@@ -2,10 +2,20 @@
PUSHD %~dp0
SET JAVA_HOME=C:\program files\java\jdk11.0.1
SET JAVA_HOME=C:\Program Files\Java\jdk1.8.0_211
MKDIR build > NUL
javac -d build/ src/*.java
SET LIBS=
FOR %%F IN (%CD%\lib\*.jar) DO SET LIBS=!LIBS!;%%F
SET LIBS=%LIBS:~1%
SET CLASSES=
FOR %%F IN (%CD%\build\*.class) DO SET CLASSES=!CLASSES!;%%F
SET CLASSES=%CLASSES:~1%
SET CLASSPATH=%CD%\build;%CD%\lib;%LIBS%;%CLASSES%
javac -d webapp/WEB-INF/classes/ src/*.java
POPD
\ No newline at end of file
@ECHO OFF
SETLOCAL enabledelayedexpansion enableextensions
PUSHD %~dp0
SET JAVA_HOME=C:\program files\java\jdk11.0.1
SET LIBS=
FOR %%F IN (%CD%\lib\*.jar) DO SET LIBS=!LIBS!;%%F
SET LIBS=%LIBS:~1%
SET CLASSES=
FOR %%F IN (%CD%\build\*.class) DO SET CLASSES=!CLASSES!;%%F
SET CLASSES=%CLASSES:~1%
SET CLASSPATH=%CD%\build;%CD%\lib;%LIBS%;%CLASSES%
java "%1"
POPD
ENDLOCAL
\ No newline at end of file
#!/bin/bash
LIBS=$(ls -R lib/*.jar | tr "\n" ":").
java -cp "${LIBS}":./build "$1"
\ No newline at end of file
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.WebServlet;
@WebServlet("/servlet-First")
public class First extends HttpServlet
{
public void service( HttpServletRequest req, HttpServletResponse res )
throws ServletException, IOException
{
res.setContentType("text/html;charset=UTF-8");
PrintWriter out = res.getWriter();
out.println( "<head><title>servlet first</title>" );
out.println( "<META content=\"charset=UTF-8\"></head><body><center>" );
out.println( "<h1>Test de ma Servlet</h1>" );
out.println( "<h2>Super ! ?a marche</h2>" );
out.println( "</center> </body>" );
}
}
\ No newline at end of file
File moved
File deleted
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment