Git Product home page Git Product logo

javalanguagecompiler's Introduction

Java Language Compiler

Description

Java Language Compiler is a simple C program that automates the process of compiling and running Java programs. It takes the file name of a Java source file as input, compiles it using the javac command, and then runs the compiled Java program using the java command.

Project Owner

Getting Started

Prerequisites

  • Make sure you have Java Development Kit (JDK) installed on your system.

Usage

  1. Clone the repository:
git clone https://github.com/ShingareOm/JavaLanguageCompiler.git
  1. Compile the C program:
gcc main.c -o JavaCompiler
  1. Run the program:
./JavaCompiler
  1. Enter the Java source file name (without the .java extension) when prompted.

  2. The program will compile the Java file and execute it automatically.

Making the Executable File Global

  1. For Linux and macOS Users

    • If you are using Linux or macOS, you can add the JavaCompiler executable to a directory in your system's PATH, so you can run it from anywhere in the terminal.

    • After compiling the C program and obtaining the JavaCompiler executable, move it to a directory that you want to use for storing your globally accessible executables. For example, you can create a bin directory in your home folder and move the JavaCompiler executable there.

    • Open your terminal and navigate to your home directory (or any other location where you stored the JavaCompiler executable).

    • Run the following command to open your shell's profile file in a text editor. Depending on the shell you are using, the profile file could be .bashrc, .bash_profile, .zshrc, or something similar.

    nano .bashrc
    • Add the following line at the end of the profile file. Replace /path/to/bin with the actual path to the directory containing the JavaCompiler executable.
    export PATH="/path/to/bin:$PATH"
    • Save and close the file by pressing Ctrl + X, then Y, and finally Enter (if you're using nano).

    • Refresh your shell by running the following command:

    source .bashrc
    • Now you should be able to run the JavaCompiler executable from anywhere in the terminal.
    JavaCompiler
    • Please ensure that the JavaCompiler executable is in a secure and trusted location, as adding directories to the PATH can potentially pose security risks if you include untrusted or malicious executables.
  2. For Windows Users

    • If you are using Windows, you can add the JavaCompiler executable to a directory in your system's PATH to run it from anywhere in the Command Prompt or PowerShell.

    • After compiling the C program and obtaining the JavaCompiler executable, move it to a directory that you want to use for storing your globally accessible executables. For example, you can create a bin directory in your C:\ drive and move the JavaCompiler executable there.

    • Open the Start menu, type "environment variables," and select "Edit the system environment variables."

    • Click the "Environment Variables" button at the bottom right.

    • In the "System Variables" section, scroll down and find the "Path" variable. Click "Edit."

    • Click "New" and enter the full path to the directory containing the JavaCompiler executable (e.g., C:\bin).

    • Click "OK" to save the changes.

    • Open a new Command Prompt or PowerShell window (or restart your existing one).

    • Now you should be able to run the JavaCompiler executable from anywhere in the Command Prompt or PowerShell.

    JavaCompiler
    • Please ensure that the JavaCompiler executable is in a secure and trusted location, as adding directories to the PATH can potentially pose security risks if you include untrusted or malicious executables.

Contributing

Contributions are welcome! If you find any issues or want to add new features, feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License.

javalanguagecompiler's People

Contributors

shingareom avatar

Stargazers

 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.