Giter Site home page Giter Site logo

java's Introduction

Java

Learning progress

1.install JAVA jre in PC install from Oracle config the JAVA_HOME, CLASSPATH, Path in the environment variables.

a.JAVA_HOME
  D:\Java\Java      //depends on your install config

b.CLASSPATH
  .;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;         //please pay attention to the "." in the front

c.Path
  %JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;

after all config, input "java -version" on commond prompt

2.install Eclipse 3.install Maven

Download Link :http://maven.apache.org/download.cgi

it's more convient to down load the Binary Zip. after installation, we may need create the local repository.once you build mvn project, IDE will firstly search the jar package from local repository, if not exists, will download from remote repository. besides, "mvn install" will package the project and install to the local repository.

modify as below in the setting.xaml file in conf.
<localRepository>D:\Java\Maven_Repository</localRepository>

4.config web env in eclipse i am using the 2020-06 eclipse, due to the clean initial env, i need to install most of the packages myse:lf. firstly, please update the mirror in the eclipse, in order to get the max internet speed.(i am using http://mirror.bit.edu.cn/eclipse/)

help->install new software->work with ---- add a new for above mirror.
select the "Web, XML, Java EE and OSGi Enterprise Development"
  -JST Server Adapters/JST Server Adapter Extensions/JST Server UI    server component
  -Eclipse Java EE Develpoper Tools/Eclipse Java Web Develpoper Tools/Eclipse Web Develpoper Tools/Eclipse XML Develpoper Tools/Eclipse XSL Develpoper Tools    java env
  (XSL is a XML data mapping software)
right click->build path-> Libraries-> JRE   select the local JRE for developing

5.create maven project in the Eclipse we may could not find the Archetype first time. please use the mvn help:system to set up the initial environment for maven.

windows->prefreences->Maven->Installation add a new to the maven package
windows->prefreences->maven->user settings(use your personal setting.xaml)

if it does not work also, select the internal type in archetype.it will download related package itself.

The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
-build path->add library->server runtime-> add your tomcat
Description	Resource	Path	Location	Type Build path specifies execution environment J2SE-1.5.
-modify the JRE in the build path
Dynamic Web Module also need change

6.config tomcat in eclipse

build path->libraries->add server run time->add you tomcat
if the character displays error with chinese in cmd, please update the tomcat/conf/logging.properties file java.util.logging.ConsoleHandler.encoding = GBK(previous is UTF-8)

7.new a package in the src/main/java named as com.jiahao.servlet(we use this package to store all servlet file.) 8.define the initial page

  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
  due to the tomcat setting in conf/we.xml, we only could named the initial jsp as "index".
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>

8.temp solution for CORS problem

add the @CrossOrigin(origins = "http://localhost:9090", maxAge = 3600) to all used controller
if you add this to a function specifically, only this function could be called cross region

java's People

Contributors

howeji avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.