devwiki:java

Java concept

C++ Code –> Executable –> OS –> CPU

Java code –> Class –> { “JVM win”, “JVM linux”, CPU that supports JAVA} –> OS –> CPU

Java is like a application (Your Java app) running in another application (JavaVM).
so you need cmd java to run your app (.class)

javac yourJavaApp.java
java youJavaApp

Java tool, library and system environment path

add java bin directory path to system environment or user profile environment variable:

  • for win dos
     set path=c:\java\bin\location;%PATH%
    • or go system property > environment variable > user variable : path; and add java location at end
  • for mac,linux
     export path=/java/bin/location:$PATH
    • or edit ~/.bash_profile, add this cmd line in it.

Portable Java JRE

  1. copy existing JRE to portable device
  2. when use, in mac or linux terminal,
    export JAVA_HOME=/jre_dir/bin/java
    export PATH=/jre_dir/bin:$PATH 

    and in dos

    set path = %PATH%;d:\jre_dir\bin
    set JAVA_HOME=d:\jre_dir\bin\java
  3. force java use local JRE instead of asking system for it
    java -verbose -jar MyApp.jar

Quick Syntax

Quick GUI dev and App dev with NetBean

Some UI design Tips:

  • hide and show part of UI
    panelA.setVisible(false);
    //ref: http://www.codecommit.com/blog/java/techniques-of-java-ui-development

Program Design Pattern

Tutorials

  • devwiki/java.txt
  • Last modified: 2021/08/28 07:44
  • by ying