Sign in to follow this  
Followers 0
Hellu

Creating a batch file for running a java project - Help

2 posts in this topic

Hello there, I could use some help for creating a batch file for my java project, and I would really appreciate any help. 3 classes exists and two of them are linked to my main file called Hangagubbe, the other two are called "Flagga" and "Gubben", those two do not have a "public void main...". I use eclipse when I code, if that have anything to do with it.

 

I have tried making a .bat file.

1. Open notepad

2. write "java myclass" without the "

3. save as a .bat file

4. click it

 

result: fail

 

result_zps09fe63d3.png

 

This is what cmd says, I have no idea on how to fix this. I have tried adding the complete pathway to java.exe but with no luck.

 

As I said, any help is appreciated!

 

//This was probably the wrong sub forum to post it in but I couldn't see any java section. Maybe I'm blind, if I am; could a mod please move it?

Share this post


Link to post
Share on other sites

You got to Compile it as a runable jar and it should be Java -jar jarname.jar

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0