Skip to main content

Posts

Showing posts with the label Java

How to install Java on your Mac 

Here I explain about how to install Java on your . You may need basic knowledge of Linux command, PHP , Java , Tomcat . Please use the link below to go to further reading if necessary. I. How to install Java II. How to install Tomcat III. How to install PHP and CGI IV. How to deploy PHP/JavaBridge V. How to deploy your PHP and Java files I. How to install Java 1. Download JDK Install most up-to-date JDK from Oracle site . Click downloaded dmg file and follow the guidance. Please follow the step explain this site if you have problem following the instruction. 2. Set up JAVA_HOME 2.1. Open Terminal and enter the following command. vim ~/.bash_profile 2.2. Enter  i  to change to insert mode. 2.3. Add JAVA_HOME as follow. export JAVA_HOME=/Library/Java/JavaVirtualMachines/{your JDK folder}/Contents/Home 2.4. Press esc button and enter  :wq  to save and quit the .bash_profile . 2.5. Enter the command below to update bash source .bash_p...

How to install Tomcat on Mac 

Here I explain how to install Tomcat on your . You may need basic knowledge of Linux command, PHP , Java , Tomcat . Please use the link below to go to further reading if necessary. I. How to install Java II. How to install Tomcat III. How to install PHP and CGI IV. How to deploy PHP/JavaBridge V. How to deploy your PHP and Java files II. How to install Tomcat 1. Download Tomcat Download tar.gz file from Apache Tomcat site and extract the file. 2. Make Tomcat folder Make /usr/local folder and move Tomcat folder to this folder. sudo mkdir -p /usr/local sudo mv ~/Downloads/apache-tomcat-9.0.0.M15 /usr/local 3. Create a symbolic link sudo rm -f /Library/Tomcat sudo ln -s /usr/local/apache-tomcat-9.0.0.M15 /Library/Tomcat 4. Change privilege sudo chown -R /Library/Tomcat 5. Make all shell file executable sudo chmod +x /Library/Tomcat/bin/*.sh 6. Command to start and stop Tomcat /Library/Tomcat/bin/startup.sh /Library/Tomcat/bin/shutdown.sh You will see t...

How to deploy PHP/JavaBridge on your Mac 

Here I explain how to deploy PHP/JavaBridge on your . You may need basic knowledge of Linux command, PHP , Java , Tomcat . Please use the link below to go to further reading if necessary. I. How to install Java II. How to install Tomcat III. How to install PHP and CGI IV. How to deploy PHP/JavaBridge V. How to deploy your PHP and Java files IV. Deploy PHP/JavaBridge 1. Download JavaBridge Download JavaBridge.war from PHP/JavaBridge site . 2. Deploy war file Move the war file to /usr/local/{your tomcat version folder}/webapps/ After few seconds, JavaBridge folder will be created. 3. Change PHP configration 3.1. Go to PHP folder Open Finder and go to directory showed on the test page. 3.2. Edit php.ini file php.ini file and add following line. allow_url_include = On 4. Restart Tomcat If you have not set up Tomcat on your local machine, here is II. How to install Tomcat . /Library/Tomcat/bin/startup.sh /Library/Tomcat/bin/shutdown.sh 5. Check JavaBridge G...

How to deploy your PHP and Java file in PHP/JavaBridge

Here I explain how to deploy your PHP and Java file in your PHP/JavaBridge folder. You may need basic knowledge of Linux command, PHP , Java , Tomcat . Please use the link below to go to further reading if necessary. I. How to install Java II. How to install Tomcat III. How to install PHP and CGI IV. How to deploy PHP/JavaBridge V. How to deploy your PHP and Java files V. Deploy your PHP and Java file In this chapter, I will not talk detail about how to create and run Java . If you are curious about how to create PHP that executes Java , check PHP/JavaBridge site. 1. Create Java Hello World 1.1. Open eclipse and create Java Project . 1.2. Create HelloWorld.java file under the project. import javax.swing.JOptionPane; public class HelloWorld {     public static final String JAVABRIDGE_PORT="8080";     static final php.java.bridge.JavaBridgeRunner runner = php.java.bridge.JavaBridgeRunner.getInstance(JAVABRIDGE_PORT);     public stat...

How to install PHP/JavaBridge on Mac 

Looking for how to execute Java from PHP or vice versa? By using PHP/JavaBridge , it is possible! Here I write the instraction of how to set up PHP/JavaBridge on your Mac . You may need basic knowledge of Linux command, PHP , Java , Tomcat . Please read following links. I. How to install Java II. How to install Tomcat III. How to install PHP and CGI IV. How to deploy PHP/JavaBridge V. How to deploy your PHP and Java files If you have any suggestion and question, especially technically and grammatically, please feel free to leave your comment. Thank you for your visit😊

Windows上でJava実行するバッチを作る

○やりたいこと libにあるJarファイルを読み込んでJavaを実行したい ■batファイルの作成 @echo off setlocal EnableDelayedExpansion for /r %%i in (.\lib\*) do set c=!c!%%i; java -Xmx1024m -Xms512m -classpath %c% jp.co.example.Main endlocal ■setlocal setlocalを使用することにより、設定した環境変数はバッチ内のみ有効となる。 ■EnableDelayedExpansion EnableDelayedExpansionを使用することにより、loop内のsetで値を文字列結合できる。 この場合変数を!で囲む ■Java実行時のメモリ -Xmx : メモリの最大値 -Xms : 起動時に確保するメモリ値 ○参考サイト http://d.hatena.ne.jp/language_and_engineering/20130502/PatternsOfMSDOSorBAT http://stackoverflow.com/questions/524081/bat-file-to-create-java-classpath http://hama4g.blogspot.jp/2013/03/setlocal-enabledelayedexpansion.html https://docs.oracle.com/javase/jp/1.3/tooldocs/solaris/java.html http://sweng.web.fc2.com/ja/program/java/java-command.html

LinuxでJava設定

○環境  CentOS 5.1 ■Javaの設定 1.Java JDKをダウンロード 今回は古いバージョンのJDKをインストールしたかったため、 OracleのJavaダウンロードアーカイブサイトより取得 2.ダウンロードしたファイルをサーバーにアップロードする。 WinSCPを使ってアップロード 3.インストーラーを実行 sh jdk-6u20-linux-i586.bin 4.JDKフォルダを移動 mv jdk1.6.0_20 /usr/local/ 5.環境設定を変更 Javaを実行するユーザの.bash_profileを変更する。 vi /home/linux/.bash_profile -------------------------------------------- export JAVA_HOME=/usr/local/jdk1.6.0_20 export PATH=$JAVA_HOME/bin:$PATH -------------------------------------------- 6.環境変数の変更を反映 source /home/linux/.bash_profile 7.Javaコマンドが使えるか確認 java -version ○参考サイト http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase6-419409.html#jre-6u20-oth-JPR http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html http://d.hatena.ne.jp/Kshi/20100226/1267183707

Windows 7でJavaの開発環境をインストール

私は以下の手順でWindows 7上にJavaの開発環境を設定しました。 1.Java SEをダウンロードする。 まだwindows 7 64bit用のJava EEはないようなので、SEを こちら からダウンロードしてみました。 バージョンは Java SE 6.0 update 26 です。ちなみに私がダウンロードしたファイルは↓です。 JDKはjdk-6u26-windows-x64.exe JREはjre-6u26-windows-x64.exe 2.Eclipseをダウンロードする。 バージョンは最新の Eclipse Indigo です。 こちら からダウンロードできます。解凍して好きな場所に置きます。 3.続いてTomcatをインストールし、設定する。 こちら のページから 32-bit/64-bit Windows Service Installer をクリックしてTomcat 7.0.xをインストールします。 インストール後、Tomcatフォルダにある conf/tomcat-users.xml に以下の ロールを追加 しなければなりません。 もし tomcat-users.xml上書き拒否されている場合は、xmlファイルのオプションのセキュリティにWindowsユーザーの許可を付けて 保存する。 4.EclipseにTomcat Pluginを追加する。 こちら のページからtomcatPluginV33.zipをクリックしてダウンロードします。解凍し、com.sysdeo.eclipse.tomcat_3.3.0フォルダーをeclipse/plugins/の中に移します。 eclipseは 管理者として実行 し、 Window→Preferences→Tomcatにてバージョン 7.xを選択 します。 TomcatホームにTomcatのフォルダーを記入 し、 コンテキスト宣言モードはService.xmlを選択 します。 5.Hello Worldを表示 ここでは詳しいソースは記載しません。サーブレットでもJSPでもいいので、localhostでHello Worldを表示してみて下さい。 うまくいけばすべてのインストールが成功...