Win a copy of Hands On Software Engineering with Python this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Running programs in jGrasp  RSS feed

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello-

I am student studying for my Bachelor's in IT.  I have never done programming before starting school, and this is only my second course, so please forgive my ignorance when it comes to my terminology.  I am currently taking a Java Programming class and am using jGrasp to write and test my code.  I was wondering if anyone has used this software?  Whenever I run the program, this is the response I get in the I/O tab:

----jGRASP exec: java A2

----jGRASP wedge2: exit code for process is 1.
----jGRASP: operation complete.


I am not able to "use" the program.. is there a setting I need to turn on in jGrasp to be able to test out my program?

Thanks in advance for any help you can provide!
 
Marshal
Posts: 62172
193
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

I haven't used JGrasp for such a long time that I have forgotten everything about it. We don't usually see exit codes, but a non‑zero code conventionally represent an error somewhere. I think it is best you show us your code.
 
Molly Matthews
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Campbell Ritchie.. thank you for your reply!  Here is my code:

 
Campbell Ritchie
Marshal
Posts: 62172
193
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That program contains neither syntax errors nor anything causing an exception at runtime. I copied what you posted unchanged.

javac A2.java
[critchie@l...$ java A2
Please enter a year, in integer format: (e.g. for year 2018, enter 2018)
2016 2
Please enter a month in integer format: (e.g.  for September, enter: 9) February 2016 had 29 days.

It is not however object‑oriented code, I am afraid. I don't know how you got errors from JGrasp, since my Oracle installation couldn't find any errors.
 
Molly Matthews
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

It is not however object‑oriented code, I am afraid. I don't know how you got errors from JGrasp, since my Oracle installation couldn't find any errors.



Thanks for looking at my code.  So are you saying, you think it is an error only within jGrasp?
 
Campbell Ritchie
Marshal
Posts: 62172
193
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Molly Matthews wrote:. . .  you think it is an error only within jGrasp?

The only error we have seen is when you run that code on JGrasp; maybe there is something wrong with your installation or configurations or something.

I downloaded jGrasp to try out your program; I had to set the PATH environment variable as a configuration feature for that class. Once I had done that, I clicked on some of the code and pushed ctrl‑R, and I found that February 2016 had 29 days.

----jGRASP exec: java A2

Please enter a year, in integer format: (e.g. for year 2018, enter 2018)
2016 2
Please enter a month in integer format: (e.g.  for September, enter: 9) February 2016 had 29 days.
----jGRASP: operation complete.

How did you set the PATH for jGrasp?
 
Molly Matthews
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

How did you set the PATH for jGrasp?



Well this is embarrassing... I have no idea.  I think I just installed it as I do not remember adjusting or setting anything up.  Is it easy to set the path or do I need to uninstall and reinstall?

Thank you so much for your help!  You have no idea how much I appreciate you assisting me!
 
Sheriff
Posts: 12814
211
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Google is your friend: How to set PATH for jGrasp

See also: https://www.jgrasp.org/tutorials187/01_Installing.pdf (Section 1.6 "Setting PATH and CLASSPATH")
 
Campbell Ritchie
Marshal
Posts: 62172
193
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Molly Matthews wrote:. . . Well this is embarrassing...  . . .

No need to feel embarrassed. When I started Java®, I had no end of difficulty because I didn't realise you have to set a System PATH. We have all been there, done that, and got the tee‑shirt. You most probably don't want to set a CLASSPATH.

Thank you so much for your help!  . . .

That's a pleasure
 
Do you want ants? Because that's how you get ants. And a tiny ads:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!