Here is the list of projects,
Java
Nice sites to learn :
codejava.net
Windows command line, BAT file Compile java
1- Very important.
1 2 3 4 |
set PATH="C:\Program Files\Java\jdk1.5.0_14\bin";%PATH% set JAVA_HOME="C:\Program Files\Java\jdk1.5.0_14" set PATH=%JAVA_HOME%\bin;%PATH% |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
rem Display environment variables for verification echo Verify current build environment settings: echo CLASSPATH: %CLASSPATH% echo JAVA_HOME: %JAVA_HOME% echo ICS211_HOME: %ICS211_HOME% echo TEXTPAD_HOME: %TEXTPAD_HOME% echo . echo PATH: %PATH% echo . rem GoTo ICS211_HOME directory d: cd %ICS211_HOME% |
To create a similar batch file, you should verify the full paths to any directories that you want to
add to your system PATH variable. Then you can make any necessary changes to this
example code, and save it as a batch file on your system.
You can download a copy of my batch file using this URL:
kutay.bat
1 2 |
// JAVA Compiler : Console> javac JavaFileName.java |
How to Run,
1 |
Console> java JavaFileName |
Context Parameter with remote port
1 2 3 4 5 6 7 8 |
Properties props = new Properties(); props.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.enterprise.naming.SerialInitContextFactory"); props.setProperty("org.omg.CORBA.ORBInitialHost", "localhost"); // glassfish default port value will be 3700, - props.setProperty("org.omg.CORBA.ORBInitialPort", "3700"); InitialContext ctx = new InitialContext(props); CalcRemote bean = (CalcRemote) ctx.lookup("java:global/TestEAR/TEjb/Calc! com.CalcRemote"); |
Please check the port with linux Terminal
1 |
$ netstat -tunap |
Context parameters
public class Main { public static void main(String[] args) throws Exception { InitialContext ctx = new InitialContext(); CalculatorRemote bean = (CalculatorRemote) ctx.lookup("java:global/TestEAR/TEjb/Calc!com.CalcRemote"); bean.sayHello("java.someload.com"); } }
How to compile java over terminal, command line , Run java file
1. You need to check, java version with this command
1 |
$ java -version |
2. Compile the code
1 |
$ javac ...... ... |
3. Run The compiled
1 |
$ java -jar compiled.jar |
1 2 3 4 5 |
javac -cp /path/to/jar/file Myprogram.java java -cp .:/path/to/jar/file Myprogram javac -cp src/external/myfile.jar me.java java -cp .:src/external/myfile.jar me |
1 2 3 4 5 6 7 8 9 10 11 12 |
// Java Files java -Djava.library.path="libs/natives/" -cp libs/jars/lwjgl.jar:libs/jars/lwjgl_util.jar DisplayTest // External jar files 1) Use the CLASSPATH enviroment variable, as in: CLASSPATH=.:/path/to/lwjgl/lwjgl.jar:/path/to/lwjgl/lwjgl_util.jar export CLASSPATH // Run java app java -Djava.library.path="libs/natives" DisplayTest |
How to compile java over terminal, command line , Run java file
1. You need to check, java version with this command
$ java -version
2. Compile the code
$ javac …… …
3. Run The compiled
$ java -jar compiled.jar
1 2 3 4 5 |
javac -cp /path/to/jar/file Myprogram.java java -cp .:/path/to/jar/file Myprogram javac -cp src/external/myfile.jar me.java java -cp .:src/external/myfile.jar me |
1 2 3 4 5 6 7 8 9 10 11 12 |
// Java Files java -Djava.library.path="libs/natives/" -cp libs/jars/lwjgl.jar:libs/jars/lwjgl_util.jar DisplayTest // External jar files 1) Use the CLASSPATH enviroment variable, as in: CLASSPATH=.:/path/to/lwjgl/lwjgl.jar:/path/to/lwjgl/lwjgl_util.jar export CLASSPATH // Run java app java -Djava.library.path="libs/natives" DisplayTest |